Does anyone know anything about batch files? I'm trying to make one that will close firefox and then open it again. I can get it to start firefox again, but I've been looking around for a way to close it, but I can't get any of it to work.
All help appreciated!
Thanks!
Page 1 of 1
Batch file help please
#2
Posted 24 November 2006 - 12:42 AM
Try This
Quote
@Echo Off CLS start /w taskkill /F /IM PLACE_THE_NAME_OF_APP_HERE :: Stops The Script For Approx 5 Seconds Then Restart The App ping -n 5 127.0.0.1>nul start PLACE_THE_NAME_OF_APP_HERE
This post has been edited by gunsmokingman: 24 November 2006 - 12:42 AM
#3
Posted 24 November 2006 - 08:00 AM
Since everyone tends to have cmdow.exe, but rarely uses any of its features, I thought I'd produce an alternative method for you!
For those of you not already in posession of the cmdow utility, you can download it directly here and read more here.
@CMDOW @ /HID &FOR /F %%? IN ('CMDOW /T /B ^|FIND /I "FIREFOX"') DO (IF ERRORLEVEL 0 (CMDOW %%? /END &&(PING -n 6 LOCALHOST &CMDOW /RUN FIREFOX)))
This code should all be pasted onto a single line of your batch file.For those of you not already in posession of the cmdow utility, you can download it directly here and read more here.
#4
Posted 24 November 2006 - 06:47 PM
Hmm... what is the taskkill thing? Is it an exe in system32 or something? I searched my computer for that and it wasn't there, maybe I'm missing it or something...
#5
Posted 24 November 2006 - 07:08 PM
Taskkill was implemented in Windows XP. If you're running an older OS, download pskill in it's place. If you drop pskill into your %WINDIR% the code of line three would be:
If you put pskill in the same directory as the batch file the syntax of line three would be:
I've found pskill to be more powerful than taskkill at killing some apps.
pskill firefox
If you put pskill in the same directory as the batch file the syntax of line three would be:
.\pskill firefox
I've found pskill to be more powerful than taskkill at killing some apps.
This post has been edited by quijibo: 24 November 2006 - 07:10 PM
#6
Posted 24 November 2006 - 07:09 PM
Taskkill.exe is indeed in system32. Although in WIN XP PRO.
Maybe you have the home edition and there it's called tskill.exe
Maybe you have the home edition and there it's called tskill.exe
- ← Need help assigning 'last directory name' in a path as a varia
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- VB.net, Reading 'X' number of Bytes from a file →
Share this topic:
Page 1 of 1



Help
Back to top










