Reputation: 5602
Is there a way to run any command (eg: cd D:\test) on Command Prompt start and to have this instance of Command Prompt as a different shortcut/instance.
Upvotes: 0
Views: 240
Reputation: 239636
You can create a shortcut that has a target of e.g.:
%comspec% /k ""C:\Full_Path_to\VsDevCmd.bat""
Where the .bat
file is the command(s) that you want to run on startup. This will then leave you with an open command prompt after those commands have executed.
(In case it's not obvious, this is just shamelessly ripped from one of the Developer Command Prompt shortcuts that Visual Studio installs in the Start Menu)
%comspec%
is a nice way of getting cmd
to execute.
Cmd:
/k : Carries out the command specified by string and continues.
Upvotes: 2