开发者

Batch commands execution order

开发者 https://www.devze.com 2022-12-27 11:45 出处:网络
I\'m looking to run a second batch command from开发者_运维百科 .bat but after the first command has been done.

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

精彩评论

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

关注公众号