tags:

views:

81

answers:

1

I'm looking to run a second batch command from .bat but after the first command has been done.

REN "myfile.txt" "my_file.txt"
start "title" "path"

Here, I want the rename command to be executed before the process I wanted to start that has been terminated or executed. why it doesn't work in sequence order?

Update:

Both commands work correctly in order if I put a 'pause' or /sleep between the commands.

+1  A: 

Try putting the REN command in a separate batch file--I think CALL may force the batch to wait until it returns:

-- file1.bat

CALL file2.bat "myfile.txt" "my_file.txt"
start "title" "path"

-- file2.bat

REN %1 %2
egrunin