Reputation: 36068
I have a batch script that calls a process and currently it waits for the process to complete before going to the next line. Is there a way (or a switch) for it NOT to wait and just spawn the process and continue? I am using Windows 2008.
Upvotes: 15
Views: 35540
Reputation: 57252
scriptrunner -appvscript notepad
the command has some nice features as timeout,wait and so on.
SCHTASKS /create /tn BatRunner /tr "%cd%\first.bat" /sc ONCE /sd 01/01/1910 /st 00:00
SCHTASKS /Run /TN BatRunner
SCHTASKS /Delete /TN BatRunner /F
This command main purpose is scheduling but you can use it to start another command without waiting
WMIC process call create "notepad"
this will return the PID of the started process.
Upvotes: 0
Reputation: 86698
Why not just start somecmd.exe
or start "" "some command with spaces.exe"
?
Note that if your command has spaces, you must put quotes around it, but if the first argument to start
has quote around it the command is the second argument, so I have two sets of quotes there.
Upvotes: 16
Reputation: 1494
This will probably suffice.
call "cmd /c start notepad.exe"
Upvotes: 15