How to Run Command Prompt Commands With a Desktop Shortcut
Pinterest Stumbleupon Whatsapp
Advertisement

If there’s a certain command that you want to run at will on a regular basis, you’ve probably grown tired of the cycle of launching the Command Prompt, typing in the command, closing the Command Prompt. There’s got to be a better way! And there is.

This method involves a creating file shortcut to cmd.exe, which is the Command Prompt application, and supplying a command as a parameter. When a parameter is supplied to Command Prompt, it’s automatically run when launched.

  1. Right-click anywhere in File Explorer or the Desktop and select New > Shortcut.
  2. For the location of the item, type in "C:\Windows\System32\cmd.exe" /k [your desired command here] making sure to replace the bracketed text with the command you want to run. Don’t actually type the brackets.
  3. Click Next.
  4. Give the shortcut a name.
  5. Click Finish.

windows-10-command-as-desktop-shortcut

Change /k to /c if you want the Command Prompt to close after running the command. You can include multiple commands by adding an & in there, such as [command one] & [command two] & [command three].

You can also do something similar using Windows batch scripts, which are only a little more complicated. Just create a batch file, edit it to contain the command you want to run, save it, then double-click it.

Did this help? Know of any other ways to quick-run commands in the Command Prompt just by double-clicking a shortcut? Share with us in the comments below!

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. quadstrike
    October 18, 2016 at 4:19 am

    or just make a bat file

  2. John Merc
    October 6, 2016 at 7:47 am

    Nice and Helpful article.
    However I want to know where is login link in this new website?
    And what about my saved articles?

    Thanks in advance.

  3. ultimate tech news
    October 5, 2016 at 12:45 pm

    wow great article