How to set the working directory of a command in a Windows batch file?

前端 未结 3 839
庸人自扰
庸人自扰 2020-12-29 01:26

Let\'s say I have these commands:

Prog1.exe
D:\\SomeDir\\Prog2.exe
Prog3.exe

Now, say for the second line, I would like the working directo

3条回答
  •  灰色年华
    2020-12-29 02:01

    You could use the pushd/popd commands (help with pushd /?)

    Prog1.exe
    Pushd D:\SomeDir
    Prog2.exe
    popd
    Prog3.exe
    

提交回复
热议问题