Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Basically, I'm using a software called Xpadder that lets me control my computer with a game pad. Problem is, when I start a game I need Xpadder to end. So I typed this batch file

tasklist /FI "IMAGENAME eq Xpadder.exe" 2>NUL | find /I /N "Xpadder.exe">NUL
if "%ERRORLEVEL%"=="0" (
TASKKILL /F /IM "Xpadder.exe"
)

Works a charm. Problem is though, it minimises the game when it runs! Is there anyway I can avoid this?

share|improve this question
add comment

1 Answer

You could create a shortcut to your batch-script, right-click on it and open the properties. There you'll find a drop-down where you can choose to run the script minimised.

Another way to do it would be to make the script start itself using the min parameter:

@echo off
pushd "%~dp0"
if "%1"=="done" goto runtime
for %%I in (%0) do start "" /min %%~sI done
exit

:runtime
title Minimised
echo Code goes here
pause
exit /b

I used %%~sI to run the start command with 8.3 names to prevent troubles with whitespace in path or file names.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.