Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

cmd.exe shortcuts and parameters

Writer Sophia Terry

I have made a shortcut that opens cmd at a specific directroy

How can I add a program to execute at the end of this statement?

C:\Windows\System32\cmd.exe /k cd "C:\Program Files\App" 

I have tried:

C:\Windows\System32\cmd.exe /k cd "C:\Program Files\App" "C:\Program Files\App\app.exe"

But it doesnt work

1

3 Answers

cmd /k "command1 && command2"

Also take a look at the Microsoft documentation for the command interpreter.

C:\Windows\System32\cmd.exe /k cd "C:\Program Files\App" & app

Since you're already in the directory there's no point in repeating it, so I just shortened your path to app. Anyways, use & to run multiple commands.

2

I would suggest you have cmd.exe run a script with the commands/programs you want. If it needs to be dynamic, you can make the directory name and the command to run parameters to the script.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy