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

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 7 Quick Tips to Improve the Windows Command Prompt 7 Quick Tips to Improve the Windows Command Prompt You should learn more about the Command Prompt. It's a more valuable resource than most people realize. These tips will improve your command line experience, even if you're a seasoned user. Read More , 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 15 Windows Command Prompt (CMD) Commands You Must Know 15 Windows Command Prompt (CMD) Commands You Must Know The command prompt is still a powerful Windows tool. Here are the most useful CMD commands every Windows user needs to know. Read More . Don’t actually type the brackets.
  3. Click Next.
  4. Give the shortcut a name.
  5. Click Finish.


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 Dip Your Toes in Batch File Programming for Windows Dip Your Toes in Batch File Programming for Windows Why do you let simple, repetitive tasks bore you? If you can't delegate, innovate! With Windows you can create simple little programs, called batch files, that will take care of these tiresome tasks. Read More , 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!

Explore more about: Command Prompt, Windows Tricks.

Enjoyed this article? Stay informed by joining our newsletter!

Enter your Email

Leave a Reply

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

  1. Tul
    March 1, 2019 at 4:14 pm

    Thank you for a great, super simple and direct article, with no superlative bs. Thanks

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

    or just make a bat file

  3. 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.

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

    wow great article