windows - Tracking PID in batch file and closing cmd when PID closes -
i have batch file starts html file command line in whatever default browser:
start filename.html
i looking way find out id of spawned process (firefox, ie, chrome) , track pid in order shut down cmd window when process complete.
basically, process ideally go this: start html, find pid of last spawned process, watch pid, when pid closes - cmd exit
i have tried searching around , found way find pid of process not how track until exit.
is possible in bat file? assistance lovely. thanks!
start filename.html exit
try this. know once process complete cmd closes on own.
or u can directly run file without opening cmd black window try below script save example.vbs , replace testing ur batch filename , run example.vbs file instead of batch file.
set oshell = createobject ("wscript.shell") dim strargs strargs = "cmd /c testing.bat" oshell.run strargs, 0, false
Comments
Post a Comment