@serendipity
I tried the above without wait(1000), the first command successfully terminated defraggler (GUI) while the current tab was in sandbox, but then the second command did not start at all, until I added wait in between! So there's the tradeoff between run's wait option, and open's independency of the current path! What do you think?
Is there a command to close a running program
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Is there a command to close a running program
Yes, that's the tradeoff. That's why I suggested wait here.Huidong wrote:@serendipity
I tried the above without wait(1000), the first command successfully terminated defraggler (GUI) while the current tab was in sandbox, but then the second command did not start at all, until I added wait in between! So there's the tradeoff between run's wait option, and open's independency of the current path! What do you think?
And you can shorten the first line to:
open """%ComSpec%"" /c tskill Defraggler";
-
Huidong
- Posts: 213
- Joined: 18 May 2011 21:55
Re: Is there a command to close a running program
Rocks! For reference, I just went to http://en.wikipedia.org/wiki/ComSpec
Thanks!
Thanks!
-
serendipity
- Posts: 3360
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Is there a command to close a running program
Also look at Help>Environmental variablesHuidong wrote:Rocks! For reference, I just went to http://en.wikipedia.org/wiki/ComSpec
Thanks!
-
Huidong
- Posts: 213
- Joined: 18 May 2011 21:55
Re: Is there a command to close a running program
Oh good reminder!
And here's an immediate benefit using open and %comspec%.
Compare
with the orignial
Both avoided being trapped in sandbox but the second is ugly.
Happy.
And here's an immediate benefit using open and %comspec%.
Compare
Code: Select all
"Run Registry Workshop as SYSTEM"
open '"%comspec%" /c psexec -s -i "C:\Program Files\Registry Workshop\RegWorkshop.exe"';
Code: Select all
"Run Registry Workshop as SYSTEM"
goto "%computer%", 1;
run "cmd /c cd /d C:\Windows\System32\ & PsExec -s -i ""C:\Program Files\Registry Workshop\RegWorkshop.exe""";
#520; //Go backHappy.
XYplorer Beta Club