A Y'z Dock Batch File For Auto Open/close

This is a single windows batch file i created to automatically close and open the dock via a game or via a shortcut to the batch file.

For games all you have to do is

1) point the dock icons "Link to:" value to the dock batch file eg C:\Dock.bat,

2) make the "Arguments:" value point to the game executable eg C:\Games\Quake\Quake.exe and

3) make the "Work Folder:" value point to the games working folder eg C:\Games\Quake\

Heres the batch file---->

REM --------Dock.bat BEGIN---------

IF NOT ""=="%1" GOTO process

tasklist /FI "IMAGENAME eq yzdock.exe" | find /i /c "yzdock.exe" > nul

if not errorlevel=1 goto kill

goto open

:kill

ECHO KILL

taskkill /im yzdock.exe

GOTO END

:open

ECHO OPEN

REM Change this value to point to where your YzDock.exe is located

START /b C:\Progra~1\yz\yz_dck0083\YzDock.exe

GOTO END

:process

ECHO PROCESS

taskkill /im yzdock.exe

%1

GOTO open

:END

exit

REM --------Dock.bat END---------

#31669

very nice batch file. i will try this out :)

#31726

cool, really useful

#31730

Will it still work if I add another line to kill Samurize also, and have it start back up?? I would appreciate any help with adding this.

FatAxl :own:

#31746

yeh the ":process" section is for things you want to do when you run a game and the ":kill" section is for when you run the dock.bat file by itself without sending it any arguments. The ":open" section is always used.

So for eg if you wanted to also add samurize you could do the following:

1) Add to the "process" section the line:

taskkill /im samurize.exe

(or whatever the executable is called)

2) and Add to the "open" section the line:

START /b C:\Progra~1\Samurize\Samurize.exe

(or whatever the path to samurize.exe is)

that should do it

#31761

Thank you for the help !!

FatAxl :own:

#31805

very usseful

i will try

thanks dude

#32139

How can I make this batch file run when my screensaver comes on? (I don't need my docklets updating themselves all day when I am gone). I looked around for a screensaver that would run a program (or batch) to kill YzDock.exe, but I haven't found one.

Thanks

sv3n

#32165