CMD: Create Shortcut To Command Line/Dos Programs

Posted December 9, 2003 by AlexTheBeast in Windows

Simple way to create shortcuts to command line programs. You favorite cmd is only one click away.

Command line shortcuts on the desktop? What’s next, dogs and cats living together in harmony?

1. Right click on an empty space on the desktop to open the context menu
2. Select New
3. Select Shortcut with a left-click
4. In the location box type cmd /k plus whatever command you want.

For example, if you want a shortcut to ping tech-recipes, your location box would contain:

cmd /k ping

example of command prompt on desktop

5. Select Next

6. Name your shortcut and push Finish

This works on all versions of windows including Windows 7 and Windows 8.

Example of this tutorial on windows 8.

The Conversation

Follow the reactions below and share your own thoughts.

  • nal


  • ben

    this does not work if ur administrator has blocked it (on ur school computer)

    • polytonality

      Try the pressing the ‘Windows’ and ‘R’ keys at the same time to bring up “Run”; then, type CMD and press ‘Enter’. Might work, depending on user permissions….

      • R

        I tried windows key and r on school computer and it’s blocked.

    • Anonymous

      lol just make a new file and type CMD in it then save it as somthing.bat and run it!

  • Anonymous

    This is exactly what I was looking for. I had been monitoring my ping by doing “ping -t” in the command box, but when I started doing it almost daily I figured I should find a way to automate it instead of typing every time. (Of course, it’s probably better if you have a good ping app, but this works and it’s easy.)

    Also, the site I was pinging was not That was just an example.

  • Anonymous

    Thank you for your shortcut info cmd /k to emulation shell. How can I extend this shortcut to start a dos program such as 123r23.exe ?

  • Name

    hey im at school theyve blocked cmd is there away to get it up easily without system32 and the likes

  • Varun

    Thanks for
    I have been looking for this since long…

  • bow

    how,to make shortcut from dos……..

  • bow

    please help,about that knowladge….please sent to my email..thnaks

  • Ravi_mht2005

    ok this is nice tips

  • Vikas pal


  • Mathias_pk

    lol, thanks to you i have learned how to make a fake / prank virus 🙂
    make the shortcut and type:

    cmd k shutdown -r -f -c “WARNING! your computer has detected a fatal virus and will now restart. All data will be lost after restart.” -t 59

    than change the icon of the shortcut at (right mouse) properties > change icon
    type in the upper text box pifmgr.dll (press enter and it will give you a list of nice icons to chose from)
    than you change the name of the shortcut into something that will fit with the icon and make it look like a simple nice game.

    after that when you will open it, it will give you 59 seconds and then the computer will simply restart. at the other hand, people who don’t know this will read, and think that they have installed a virus..

    if you want to test this to see if it works correctly without having to restart your computer, than you can make another shortcut:

    cmd /k shutdown -a

    this will abort the shutdown after you double click on it. 🙂

    • rich h

      Your computer will shut down on Friday and blow up. hahaha

  • Imtiyaz Shaikh

    Thanks, Its working. 🙂

  • azeem

    thhhhhhanks much

  • jrexz

    thanks a lot!
    just the one that im lookin for

  • selva

    thank you working fine

  • Leonard


  • Nabil L.

    Very very very Helpful. This is what i allways wanted on my desktop.
    This shortcut is better than The Dude Monitor LOL.

  • Bob

    Why would you ever waste your time with all this cmd line stuff when you could just drag the address bar to wherever you wanted the shortcut to be and instantly have a shortcut to tech-recipes ?

  • me2

    Thanks, that’s what I was looking for!

  • Christine Lisi

    Thanks! Exactly what I was looking for (that /k). 🙂

  • Makco10



  • Foysol

    Thanks a lot bro.
    If i want to makes a shortcut of 2 ATTRIBUTE commands to hide & protect a specific command of my pen-drive, then what i will write?
    (cmd /k attrib H R L:/ adult)?
    Here i don’t know the drive as it change each time in each port.
    Please mail me.