Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using a batch file to launch two different applications at the same time in different command line windows. Here is what I have:

start cmd /k
cd Windows\System32\ 
diskpart.exe >NUL & 
diskperf.exe >NUL &  

Repeat for every app you want to run.

I run this and it opens a new command prompt running both applications one after the other. However the other window opens and is waiting for a command.

Any ideas on putting the 2nd and following commands go into the separate command prompts per & statement.

share|improve this question
    
Is powershell an option instead of batch? –  jftuga Aug 17 '11 at 14:36
    
yes. Powershell is an great option. Ideas on how to do this in powershell? –  mikedopp Aug 17 '11 at 14:41

4 Answers 4

up vote 2 down vote accepted

Try this:

cd Windows\System32\ 
cmd /k diskpart.exe
cmd /k diskperf.exe
share|improve this answer
    
nope still runs just one cmd prompt window and never launches the second cmd. –  mikedopp Aug 17 '11 at 14:52

Tweeked what @TiZon put.

start cmd /k diskpart.exe
start cmd /k diskperf.exe
share|improve this answer
    
Yeah tried that with: start cmd /k cd windows\system32\ diskpart.exe & start cmd /k cd windows\system32\ diskperf.exe still get two cmd prompts but says system cannot find the path specified. –  mikedopp Aug 17 '11 at 15:02
    
actually that works. Can I do this with CLI apps in program folders? I have set the environmental variable of the Program folder however it crashes when I do this. –  mikedopp Aug 17 '11 at 15:09
1  
What does it actually say? "notsohappyresults.exe is not recognized as an internal or external command"? –  Nixphoe Aug 17 '11 at 15:59
1  
I'm out of ideas other than seeing exactly what you're seeing –  Nixphoe Aug 17 '11 at 16:33
2  
Where did you put the quotes Mike? it should look like: start cmd /k "c:\program files\some program\app.exe" –  RobW Aug 17 '11 at 16:42

I'm using Windows XP, so YYMV with more recent versions.

The redirection is hiding execution problems with Diskpart.exe and if it got that far, for diskperf.exe as well. Diskpart is waiting for input, and diskperf requires a command line arguement.

If I understand you correctly, you want near parallel execution of diskpart.exe and diskperf.exe.

This might accomplish what you want - create a batch file with these lines:

start cmd.exe /k "diskpart.exe &exit"
start cmd.exe /k "diskperf.exe /? & pause &exit"
start cmd.exe /k "c:\progra~1\intern~1\iexplore.exe &exit"

I've removed the redirection, and made the output of each command visible. The trailing &exit closes the window when the command is finished. Remove the &pause lines and the programs will exit normally.

I could only get IE to launch if I reduced the path to its 8.3 format.

share|improve this answer

use

cd Windows\System32\

call diskpart.exe

call diskperf.exe

try

call start cmd /k diskpart.exe call start cmd /k diskperf.exe

share|improve this answer
    
That works but keeps the commands in one command line window –  mikedopp Aug 17 '11 at 15:52

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.