Create A Shortcut That Opens The Command Prompt & Runs A Command:
Yes! You can create a shortcut to cmd.exe with a command specified after it. Alternatively you could create a batch script, if your goal is just to have a clickable way to run commands.
Steps:
Right click on some empty space in Explorer, and in the context menu go to "New/Shortcut".
When prompted to enter a location put either:
"C:WindowsSystem32cmd.exe /k your-command
" This will run the command and keep (/k) the command prompt open after.
or
"C:WindowsSystem32cmd.exe /c your-command
" This will run the command and the close (/c) the command prompt.
Notes:
Tested, and working on Windows 8 - Core X86-64 September 12 2014
If you want to have more than one command, place an "&" symbol in between them. For example: "C:WindowsSystem32cmd.exe /k command1 & command2
".
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…