[help]closing Multiple Apps Using Batch File

Evenin' all. Waaaaay back - we're talking BS (Before Seph) someone posted a topic about how you could use a batch file to close a number of programs, then run a file; then when that file closed it would start up the previously closed programs again. What I'm trying to do is close AveDesk, YzDock and some other programs, and then run a game, then make AveDesk, etc start up again automatically when I close that game. I've had a good look around, and whilst I found that paticular topic the instructions did not work with multiple apps - it only told you how to close/re-open one. Can anyone help or tell me what commands I should use? Please remember I'm new to all this batchfile stuff, so try not to get all technical on me or we'll be here all night. And I know how much you'd hate that :D

Anyway, any help is appreciated!

#190542

to open more than one app, you can just combine the commands.

example:

@start "" "C:\Program Files\RegCleaner\Regcleanr.exe"
@start "" "C:\Program Files\Spybot - Search & Destroy\SpybotSD.exe"

launching the .bat file will launch regcleaner and spybot.

you can do the same for closing, or opening and closing.

#190560

O.k. I did this to kill all my emulation apps when I was playing a game

and then open them all up again when I finished. Take a look

@echo off
taskkill /f /im objectdock.exe   (Replace with the name of yours)
taskkill /f /im YzShadow.exe
taskkill /f /im YzToolbar.exe
taskkill /f /im rainmeter.exe
taskkill /f /im rainlendar.exe
taskkill /f /im explorer.exe    (Remove this line if you don't want it to kill the shell)

C:\   (Replace with your drive letter)
cd\
cd program files\rockstar\gtavc   (Replace with the path to your game or app)

gtavc.exe    (Replace with the name of the exe file of your app)

Replace these with the paths to your apps:

c:\program files\Stardock\objectdock\objectdock.exe
c:\program files\Yztoolbar\yztoolbar.exe
c:\program files\YzShadow\Yzshadow.exe
c:\program files\rainmeter\rainmeter.exe
c:\program files\rainlendar\rainlendar.exe
c:\windows\explorer.exe

#190695

Strange, that doesn't seem to be working. I click it, a command window pops up and then goes away. Here's what I put in the batch file:

@echo off
taskkill /f /im YzShadow.exe
taskkill /f /im YzToolbar.exe
taskkill /f /im YzDock.exe
taskkill /f /im 3R-1C.exe
taskkill /f /im avedesk_rc1.exe

C:\   (Replace with your drive letter)
cd\
cd Program Files\Wolfenstein - Enemy Territory   (Replace with the path to your game or app)

ET.exe    (Replace with the name of the exe file of your app)

Replace these with the paths to your apps:
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\3R-1C.exe
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\avedesk_rc1.exe
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\YzDock.exe
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\YzShadow.exe
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\YzToolbar.exe

#190710

You forgot to remove the instructions I put in. It won't work if it's there.

Your BAT file should look like this :

@echo off
taskkill /f /im YzShadow.exe
taskkill /f /im YzToolbar.exe
taskkill /f /im YzDock.exe
taskkill /f /im 3R-1C.exe
taskkill /f /im avedesk_rc1.exe

C:\
cd\
cd Program Files\Wolfenstein - Enemy Territor

ET.exe  

C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\3R-1C.exe.lnk
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\avedesk_rc1.exe.lnk
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\YzDock.exe.lnk
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\YzShadow.exe.lnk
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\YzToolbar.exe.lnk

If your linking the batch file to shortcuts you have to add .LNK at the end

(shortcuts extension). Another problem might be the fact that the folder

in wich ET.exe is located has a dash in it and it's a verry long name. Try

to shorten it. Hope this helps :)

#190714

Taskkill.exe is not available under XP Home edition, but you can download

it at MS. Look for "Back Office Resource Kit".

#190716

Oh damn. I thought it was Professiona :(

#190734

Whoops, sorry; should have said I was on Home Edition. Anyway, I've searched Microsoft.com and Google for the "Back Office Resource Kit" and I can't find anywhere to download it. All I've found is instructions of how to use it >.

#190749

Hi there, this is not from M$ but might just work: link

#190753

Thanks spngbb. So instead of 'taskkill /f /im YzShadow.exe' I would need to put something like '/f /im YzShadow.exe -pskill' or 'pskill /f /im YzShadow.exe'? :blink:

#190758

no no no it's just c:\windows\pskill.exe yzdock.exe

#190759

Ah, clever. So my finished file would be a'something like this?

@echo off
c:\windows\pskill.exe YzShadow.exe
c:\windows\pskill.exe YzToolbar.exe
c:\windows\pskill.exe YzDock.exe
c:\windows\pskill.exe 3R-1C.exe
c:\windows\pskill.exe avedesk_rc1.exe

C:\
cd\
cd Program Files\Wolfenstein - Enemy Territory

ET.exe  

C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\3R-1C.exe.lnk
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\avedesk_rc1.exe.lnk
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\YzDock.exe.lnk
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\YzShadow.exe.lnk
C:\Documents and Settings\Owner\Start Menu\Programs\Hewlett-Packard\Startup\YzToolbar.exe.lnk

#190766

Yeah that worked for me

#190769

OK, I think we're getting there. The apps closed, and the game ran. But when I closed the game, the apps didn't start back up again. >.

#190813

Right then do it like this

@echo off
c:\windows\pskill.exe YzShadow.exe
c:\windows\pskill.exe YzToolbar.exe
c:\windows\pskill.exe YzDock.exe
c:\windows\pskill.exe 3R-1C.exe
c:\windows\pskill.exe avedesk_rc1.exe

"c:\Program Files\Wolfenstein - Enemy Territory\et.exe"

start c:\"Program Files"\(your 3r-1c folder)\3r-1c.exe
start c:\"etc....."

Make sure that for the last command (start ....) all that has spaces is quoted. And don't make the links link to your startup folder, write the proper path.

#190829

Hi.

perhaps this is a little off topic, but iFido do you gain any performance at all by shutting down the shell?

/regards me

#190844

Wahey! I've had do to a little bit of jiggery-pokery (love that word :D) but I've managed to make it work. Thanks so much guys for your help :)

#192667

Simon,does the cmd.exe window close when the game starts?

If not how can that be done, if that is possible.

And what "jiggery-pokery" did you do? :D

#192671