Your cart is currently empty!
How to Run Command Prompt Commands With a Desktop Shortcut
Need to run a Command Prompt command fast—without typing it out each time? You can turn that command into a desktop shortcut. This is a quick and easy way to automate tasks, launch diagnostics, or streamline your workflow with a double-click.
Here’s how to create a desktop shortcut that runs any Command Prompt (CMD) command in Windows.
Step 1: Right-Click on Your Desktop
Start by creating a new shortcut:
- Right-click on your desktop.
- Select New > Shortcut.
Step 2: Enter the Command
When prompted to enter the location of the item, use this format:
cmd /c your-command-here
Example 1: Open Notepad
cmd /c notepad
Example 2: Ping Google
cmd /c ping google.com
Example 3: Run a batch file
cmd /c "C:\Path\To\Your\File.bat"
cmd /c
tells Windows to open Command Prompt, run the command, then close it.
Click Next after entering your command.
Step 3: Name Your Shortcut
Give your shortcut a name that makes sense, like:
- “Open Notepad”
- “Ping Google”
- “Run Cleanup Script”
Then click Finish.
Step 4: Customize the Shortcut (Optional)
You can change the icon or run the command as administrator:
To Change the Icon:
- Right-click the shortcut > Properties.
- Click Change Icon.
- Pick from the list or browse to a custom icon.
To Run as Administrator:
- Right-click the shortcut > Properties.
- Under the Shortcut tab, click Advanced.
- Check Run as administrator, then click OK.
This is helpful for commands that require elevated privileges, like sfc /scannow
or disk cleanup scripts.
Bonus: Use Command Line Parameters
You can chain commands or add switches directly in the shortcut:
cmd /c "ipconfig && pause"
This runs ipconfig
and keeps the window open so you can read the output.
Wrap-Up
Using desktop shortcuts to run CMD commands saves time and keeps things efficient—especially for repetitive tasks. Whether you’re automating system checks, launching programs, or debugging network issues, a simple shortcut can do the job in one click.
Give it a try and build a custom toolkit right on your desktop.
Tech enthusiast and content creator passionate about making technology simple for everyone. I share practical tips, guides, and reviews on the latest in computers, software, and gadgets. Let’s explore the digital world together!