BAT file to open CMD in current directory

前端 未结 17 1966
清酒与你
清酒与你 2020-12-22 18:09

I have many scripts which I interact with from the command line. Everytime I need to use them, I have to open a command line window and copy+paste and CD to the path to the

17条回答
  •  Happy的楠姐
    2020-12-22 18:15

    You could add a context menu entry through the registry:

    1. Navigate in your Registry to HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell and create a key called "Command Prompt" without the quotes.

    2. Set the default string to whatever text you want to appear in the right-click menu.

    3. Create a new key within your newly created command prompt named "command," and set the default string to

      cmd.exe /k pushd %1
      

    You may need to add %SystemRoot%\system32\ before the cmd.exe if the executable can't be found.

    1. The changes should take place immediately. Right click a folder and your new menu item should appear.

    Also see http://www.petri.co.il/add_command_prompt_here_shortcut_to_windows_explorer.htm

提交回复
热议问题