TechSpot

Stop processes .bat or .exe file

By plasma dragon00
Jan 15, 2008
Topic Status:
Not open for further replies.
  1. well, ive made a few before (none like this though), and i have recently been doing a LOT more intense gaming with my computer, where any extra program can drop my framerate to below 40. so before i play ill open up task manager and end all the processes i usually do. now heres the question:

    is there a way to make a .bat or .exe file, that, when executed, will end all processes listed in the .bat or .exe file? something like - end explorer.exe

    something along those lines. could someone give me a template on how to make one, if its possible? i can insert all of the process names myself, unless you want me to post them all ;)

    and another thing - is there a way to make it do the complete opposite of the process listed above? like - start explorer.exe

    the second thing is less important, but would be helpful also :) and by the way, explorer.exe was just an example. i dont end that lol, unless my pc is frozen. normally i'll end programs like iTunesHelper.exe, TrueTransparency.exe, etc etc etc....

    thanks for the help :)
     
  2. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

  3. plasma dragon00

    plasma dragon00 TS Rookie Topic Starter Posts: 192

    thank you so much :) :) :)
     
  4. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

    I've made a hundred batch files, to run from Cd (cause there easy to understand)

    If you need more specific help let me know
     
  5. plasma dragon00

    plasma dragon00 TS Rookie Topic Starter Posts: 192

    well, i already have a question lol

    im pretty sure that for the start one i would need to write in the full file directory if it isnt part of windows, right? (like explorer.exe would just work, as opposed to C:\Program Files\TrueTransparency\Truetransparency.exe)

    and also, what parameter would i use for the start one? /d Path? i also thought it could have been /b, bot after looking at it a second time the /d one seems like it would be right.

    so here are some examples (kept to 2 items each lol), and i have 3. are these right?

    for ending a program...

    Code:
    taskkill /im iTunes.exe
    taskkill /im TrueTransparency.exe
    
    for starting programs...

    Code:
    start /d C:\Program Files\TrueTransparency\TrueTransparency.exe
    start /d C:\Program Files\ViStart\ViStart.exe
    
    and, say, to reset explorer.exe in case it hangs (manually doing it normally fixes it)

    Code:
    taskkill /im explorer.exe
    start /d explorer.exe
    
    or would it be...
    start FileName explorer.exe ?

    once again, thanks a whole bunch for those links. im pretty sure i understand the taskkill one but the start one seems a little more confusing.

    well, time to restart my pc so i can get all the normal processes in there lol before i write the taskkill one.

    ~plasma

    EDIT: one last quick thing. it shouldnt matter whether its a .bat or .exe file, right?
     
  6. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

    You can also check out CALL
    http://technet.microsoft.com/en-au/library/bb490873.aspx

    Yes use the entire path (I do - hence CD)

    No I don't use that
    Unless you know the process ID Explorer.exe is starting see: Filemon
    Start the program and check Filemon, to what got started
    Can be difficult to use the first time, it does have a pause option
     
  7. plasma dragon00

    plasma dragon00 TS Rookie Topic Starter Posts: 192

    well, i just made my first end processes file so lets hope that works lol :)

    EDIT: its not working... hmm. if i use the /f parameter (ive used it before) where do i put that?

    taskkill /im truetransparency.exe /f ?

    EDIT 2: hmm cant get it to work... does this code look about right, because this is what im trying to get work.

    Code:
    taskkill /im iTunes.exe
    taskkill /im iPodService.exe
    taskkill /im firefox.exe
    taskkill /im aolsoftware.exe
    taskkill /im TrueTransparency.exe
    taskkill /im aawservice.exe
    taskkill /im aim6.exe
    taskkill /im aolload.exe
    taskkill /im AppleMobileDeviceService.exe
    taskkill /im avgas.exe
    taskkill /im fdm.exe
    taskkill /im firefox.exe
    taskkill /im InCD.exe
    taskkill /im InCDsrv.exe
    taskkill /im steam.exe
    taskkill /im TrueTransparency.exe
    taskkill /im ViStart.exe
    
     
  8. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

    Why do you have to restart

    just taskill the process in windows
     
  9. plasma dragon00

    plasma dragon00 TS Rookie Topic Starter Posts: 192

    i meant restart so i can get all the processes back that load at windows startup. i cant remember half of them. that code in my edit above, does that look about right? or am i missing something, because it isnt working.
     
  10. kimsland

    kimsland Ex-TechSpotter Posts: 18,353

    Hi plasma dragon00, had to step out

    Now as an example
    taskkill /im firefox.exe (that you have in your list)
    Once you end the task using the batch program, you can then just run:

    call "C:\Program Files\Mozilla Firefox\firefox.exe" (obviously inside the batch, and from a command line)

    eg

    @echo off
    echo Hi plasma dragon00
    call "C:\Program Files\Mozilla Firefox\firefox.exe"
    echo.
    pause
    taskkill /im firefox.exe
    pause
    echo all done
    pause
    exit

    obviously the pause doesn't need to be there
    and the echos
     
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.