Batch User Posted November 24, 2006 Share Posted November 24, 2006 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! Link to comment Share on other sites More sharing options...
gunsmokingman Posted November 24, 2006 Share Posted November 24, 2006 (edited) Try This@Echo OffCLSstart /w taskkill /F /IM PLACE_THE_NAME_OF_APP_HERE:: Stops The Script For Approx 5 Seconds Then Restart The Appping -n 5 127.0.0.1>nulstart PLACE_THE_NAME_OF_APP_HERE Edited November 24, 2006 by gunsmokingman Link to comment Share on other sites More sharing options...
Yzöwl Posted November 24, 2006 Share Posted November 24, 2006 Since everyone tends to have cmdow.exe, but rarely uses any of its features, I thought I'd produce an alternative method for you!@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. Link to comment Share on other sites More sharing options...
Batch User Posted November 25, 2006 Author Share Posted November 25, 2006 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... Link to comment Share on other sites More sharing options...
quijibo Posted November 25, 2006 Share Posted November 25, 2006 (edited) 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:pskill firefoxIf you put pskill in the same directory as the batch file the syntax of line three would be:.\pskill firefoxI've found pskill to be more powerful than taskkill at killing some apps. Edited November 25, 2006 by quijibo Link to comment Share on other sites More sharing options...
DJPro Posted November 25, 2006 Share Posted November 25, 2006 Taskkill.exe is indeed in system32. Although in WIN XP PRO.Maybe you have the home edition and there it's called tskill.exe Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now