Answer the question
In order to leave comments, you need to log in
How to run cmd code in JS without first creating the cmd file itself?
I start the cmd.exe process in js like this:
native_async("processmanager", "start", JSON.stringify({location: "cmd.exe", working_folder: "", waitfinish: true, arguments: "", version: 2}))!
@for /f %%i in ('set /a 1^^^<^^^<10') do @for %%j in ("C:\Users\username\Downloads\test5\yd\*.txt") do @if %%~zj leq %%i del "%%j"
Answer the question
In order to leave comments, you need to log in
Pass the command as parameters to cmd. On the command line, it would look something like this:
cmd.exe /C @for /f %i in ('set /a 1^^^<^^^<10') do @for %j in ("C:\Users\username\Downloads\test5\yd\*.txt") do @if %~zj leq %i del "%j"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question