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.
14 Answers
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.exeObviously replace game.exe with your exe. Place the batch file next to your game exe and run it instead.
I've had similar problems with Diablo 2 on Windows 7. Got it fixed by setting the compatibility mode to Windows XP. Right click on the exe -> properties -> click the compatibility tab and from there you can enable the compatibility mode and choose which OS is most suitable for the program. This have saved me alot of times.
I was actually searching for the batch code to end explorer while executing a certain program. GTA IV is totally unplayable on my computer while explorer is running heh
if explorer dont start after exit game try:
taskkill /f /IM explorer.exe
game.exe
C:\windows\explorer.exe///info to last line: or yours path to windows folder
You can set up a batch file to do this.
Open up notepad, and after you are done, save it and name it something like "start_game.bat" and change the file type to "all files". This step makes sure the file extension gets changed to .bat
@ECHO OFF
"C:\path to your game\game.exe"
TASKKILL /F /IM explorer.exe
:taskcheck
TASKLIST /FI "IMAGENAME eq game.exe" /FI "STATUS e q running"
GOTO loop_check
:loop_check
TASKLIST /FI "IMAGENAME eq game.exe" 2>NUL | find /I /N "game.exe">NUL
IF "%ERRORLEVEL%"=="0" GOTO start_explorer ELSE GOTO loop_check
:start_explorer
"C:\windows\explorer.exe"
PAUSE
I haven't tested this on my own machine, so it may need minor adjustments.
Basically, what this (should) do is start your game's exe file, kill the explorer.exe task, and then loop to check to see if your game's exe is running. If it is, check it again. If it isn't, start explorer.exe
Make sure to change the references to "game.exe" to whatever the executable of your game is.
Out of curiosity, what game is it that you're trying to run?
2