open command prompt window and change current working directory

后端 未结 7 920
时光说笑
时光说笑 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:45

    This works for me:

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

    The quoted string is actually two commands (separated by a double ampersand): The first command is to change to the specified directory, the second command is to change to the specified drive letter.

    Put this in a batch (.BAT) file and when you execute it you should see a Command Prompt window at the specified directory.

提交回复
热议问题