Windows – Killing explorer.exe when a process starts and restarting it when a process ends

shortcutswindows 7windows-explorer

I have a game which doesn't look perfect as long as explorer.exe is running. Currently the process is to start the game, kill explorer.exe from the task manager then once the game is done restart explorer from the task manager. I was wondering if there was some way to set up the shortcut for the game to do this. I know you can execute commands from within the shortcut's properties, but I don't know how.

Just to restate, I want to have the shortcut kill explorer.exe, start the game, then restart explorer.exe once the game is finished.

I am running Windows 7 Professional 64-bit.

Best Answer

I've had a similar problem with a game I have. You can easily create a short batch script that will kill and restartexplorer.exe and then run the batch script whne you want to start the game. Here's the script startgame.bat:

@echo off
taskkill /f /IM explorer.exe
game.exe
Start explorer.exe

Obviously replace game.exe with your exe. Place the batch file next to your game exe and run it instead.