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.

I'm using Windows 7, and have a simple batch file to copy portable executables off my thumb drive to %TEMP%, and then start them. The goal is to prevent Windows from holding my thumbdrive hostage until I kill all the programs I started up from it.

However the control flow does not continue to the next app unless I kill the first one, which obviously doesn't work for this purpose.

In a Unix shell script I'd simply add & after the executable I start up, but I can't find an equivalent for batch files.

How can I do this?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

You can use the start command.

Like so: start someprogram.exe

It will start the program then give control back to the main batch file, running the second program in the background.

share|improve this answer
    
Excellent: thanks. I'm sure that was a painfully dumb question to anyone who regularly works with batch files. –  iconoclast Aug 23 '12 at 22:33
2  
If the path for the executable contains spaces, you need to use start "" "foo\my program.exe". Type start /? for details. –  paradroid Aug 23 '12 at 22:33
1  
Not dumb at all, it's a good question. You can also run batch files from other batch files using the call command. On StackOverflow.com there's a question with a list of cool tricks you can do on the Windows command line, it's great! –  Mark Allen Aug 23 '12 at 23:42
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.