open command prompt window and change current working directory

后端 未结 7 841
时光说笑
时光说笑 2021-02-01 14:16

I\'m terribly new to scripting on windows. Using windows 7 64.

I\'m trying to make a .bat file that I can double click, and have it open a command prompt and automatical

7条回答
  •  失恋的感觉
    2021-02-01 14:42

    This could be done like that:

    @ECHO OFF
    cd /D "C:\my\destination"
    cmd.exe
    

    If you need to execute a file or command after you open the cmd you can just replace the last line with:

    cmd.exe /k myCommand
    

提交回复
热议问题