2

I have created batch file with specific settings for my work. I have created desktop shortcut to launch batch file and assigned Shortcut to it. But when I press shortcut keys, It only launches one session, unlike other application shortcut(When after pressing shortcut keys new session gets launched.) How can I start new session for every shortcut key press ?

I used target of shortcut as cmd.exe /k D:\WorkDir\Scripts\launchDevEnv.bat

enter image description here

1 Answer 1

1

Use the following as the command of the shortcut :

cmd.exe /c start "" cmd.exe /k D:\WorkDir\Scripts\launchDevEnv.bat

This will start a new CMD session, while the cmd.exe /c session terminates immediately after.

(Note that programs residing in C:\Windows\System32 don't need a full path.)

1
  • Perfect ! Thanks ! Commented Jun 6, 2022 at 12:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .