How To Create Shortcuts To Command Line Tools

The Windows command line offers access to many useful tools ranging from file system control to networking. A switch you might not know about the cmd.exe tool is /k which keeps the command line window open after the command is run instead of closing it. This is useful for creating shortcuts to run command line tools.

For example, if you want to create a shortcut to ping a particular computer (such as your mail server) you would create a shortcut like so:

  1. Right click on the desktop and select New > Shortcut.
  2. For the location of the item, enter the command. In this case: cmd /k ping my.mailserver.com
  3. Save your changes.

Now you just have to double-click on the shortcut to run a ping test on your server and the results window will stay open to allow you to review the results and/or run additional commands without having to open another command line window.

Free eBook!

Like what you read?

If so, please join over 28,000 people who receive our exclusive weekly newsletter and computer tips, and get FREE COPIES of 5 eBooks we created, as our gift to you for subscribing. Just enter your name and email below:

Post A Comment Using Facebook

What’s Your Preference?

Daily Alerts

Each day we send out a quick email to thousands of PCMECH readers to notify them of new posts. This email is just a short, plain email with titles and links to our latest posts. You can unsubscribe from this service at any time.

You can subscribe to it by leaving your email address in the following field and confirming your subscription when you get an email asking you to do so.

Enter your email address for
Daily Updates:

Weekly Newsletter

Running for over 6 years, the PCMECH weekly newsletter helps you keep tabs on the world of tech. Each issue includes news bits, an article, an exclusive rant as well as a download of the week. This newsletter is subscribed to by over 28,000 readers (many who also subscribe to the other option) - come join the community!

To subscribe to this weekly newsletter simply add your email address to the following field and then follow the confirmation prompts. You will be able to unsubscribe at any time.

Enter your email address for
Free Weekly Newsletter: