开发者

Batch commands execution order

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.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜