15 Brilliant Command Prompt – CMD Tricks You Might Not Know About

Ashish is a staff writer and video editor at Guiding Tech. He loves all things tech and has a soft corner for Android. Apart from contributing articles here, he also takes care of our YouTube Channel.

Supreeth is passionate about technology and dedicates himself to helping people figure it out. An engineer by education, his understanding of the inner workings of all types of gadgets and devices ensures he provides top-notch guidance, tips, and recommendations to his readers. When away from the desk, you will find him traveling, playing FIFA, or hunting for a good movie.

Before we get started, here are a few things you need to keep in mind.

With that in mind, here are some useful command prompt commands that we want to show you!

1. Check Wi-Fi Password Using CMD

Did you forget the password of a previously connected Wi-Fi network on your Windows PC? Here’s how you can use Command Prompt to check the Wi-Fi password.

Step 1:Enter the following command on CMD.

Step 2:You will see a list of Wi-Fi networks that are connected. Now, enter the below command, and replace NETWORK_NAME, with the name of the network you are searching the password for.

The ‘key component’ is the password for the Wi-Fi network.

2. Check System Uptime

System uptime refers to the duration for which a computer has been continuously running without a restart. Enter the below command to find the system uptime using CMD on your Windows PC. Wait for the information to load, and you will be able to see the system boot time.

3. Empty Recycle Bin

You can also easily empty your recycle bin on your Windows PC using CMD. Enter the command below to instantly delete all the files in the recycle bin!

4. Check the Network Ping

The ping command in CMD is a network utility that sends a small packet of data to a specific IP address or domain name to test the connection and measure the time it takes for the data to travel to the target and return. It measures the round-trip time for data packets to travel to a destination and back, indicating network latency or responsiveness.

Enter the following command on CMD while your PC is connected to the internet,

5. Hide a File or Folder

You can also hide a file or a folder using Command Prompt on your Windows PC.

To hide a file, enter the following command.

Replace file_path with the path of the file.

To hide a folder, use the following command. Replace folder_path with the destination path of the folder.

Find Hidden Files

Hidden files or folders won’t be visible in File Explorer unless you’ve enabled the option to view hidden items. Go to theViewtab in File Explorer in the destination where the file was initially present, and check theHidden itemsbox. However, do note that the hidden file/folder will be present in the same destination – except that it won’t be visible.

Unhide Files

To unhide a file, enter the following command.

Replace file_path with the path of the file.

To unhide a folder, use the following command. Replace folder_path with the destination path of the folder.

Alternatively, you can alsoright-clickon the hidden file or folder, and selectProperties. Uncheck thehiddenoption to unhide the file/folder.

6. Check Command Prompt History

It is easy to get lost between the commands you’ve entered and the responses and output from the CMD tool. Here’s how you can easily access thehistory on Command Prompt.

There is a keyboard shortcut to view the history on CMD quickly. You can hold theF7key or hold the ‘Fn’ key with F7 to access the history of your commands. It will appear in the form of a dialog box.

You can use the up and down arrow keys to navigate through your commands. Hit the enter key to execute the highlighted command.

7. Open a File Using CMD

Here’s how you can easily open a file using Command Prompt on your Windows PC.

Step 1:Typecd, followed byfile path, and hitenter.

To copy the path of any folder,right-clickon the folder and click onCopy as Path. Our folder path here is “C:\Users\rsupr\OneDrive\Desktop\Sample Folder”.

Note:Ensure to enter all the paths within double quotes.

Step 3:Next, enter thefile nameand itsextensionin double-quotes.

The name of the file we are using is “Sample Image” and its extension is “.png”.

Step 4:Hit theenterkey, and the file will open.

8. Move or Copy Files or Folder Using CMD

You can easily move a file or a folder from one location, or copy them to another using CMD. Here are some of the CMD tricks that help you do so!

Typecdand paste the path of the file you want to copy or move. Hit theenterkey.

To copy the path of any folder,right-clickon the folder and click onCopy as Path. Our folder path here is “C:\Users\rsupr\OneDrive\Desktop\Sample Folder”.

Our file is “Sample Image.png” and the destination path is “C:\Users\rsupr\OneDrive\Documents”.

Note:Ensure to enter all the paths, the filename, and its extension within double quotes.

Note:If a file of the same name exists in the destination folder, you will receive a prompt whether you want to overwrite the file or abort the process. TypeY(yes) to overwrite orN(no) to abort, and hitenter.

Our file is “Sample Image.png” and the destination path is “C:\Users\rsupr\OneDrive\Documents”.

Note:Ensure to enter all the paths, the filename, and its extension within double quotes

Note:If a file of the same name exists in the destination folder, you will receive a prompt whether you want to overwrite the file or abort the process. TypeY(yes) to overwrite orN(no) to abort and hitenter.

9. Delete a File Using CMD

Here’s how you can delete a file using CMD on your Windows PC.

Step 1:Typecd, followed by the file’s path you want to delete. Hit theenterkey.

To copy the path of any folder,right-clickon the folder and click onCopy as Path. Our folder path here is “C:\Users\rsupr\OneDrive\Desktop\Sample Folder”.

Note:Ensure to enter all the paths within double quotes.

Step 2:Typedelfollowed by the name of the file you want to delete. Hit theenterkey.

Ensure to enter the filename and its extension within double quotes. The name and extension of the file we are using are “Sample Image” and “.png”.

10. Run a System File Checker

The WindowsSystem File Checker – SFC scanis a tool you can use on Command Prompt that detects any corrupted files on your PC. Once detected, it attempts to repair and restore the file. This is a tool that you can use if you are encountering any problems while using your Windows PC.

Type the following command :

As the system scan begins, you can see its progress. Once the system scan is complete, you will see whether it is successful or not.

11. Remove Bluetooth Devices Using CMD

If you’re unable toremove a Bluetooth devicefrom your Windows PC, CMD can help you get rid of such stubborn devices. Here’s how :

First, we need to find a parameter called ‘Device instance path’ that helps Command Prompt identify your Bluetooth device.

Step 1:OpenDevice Manager from the Start menu on your Windows PC.

Step 2:You will see a list of device categories. Click onBluetooth.

Step 3:Find the device that you want to remove.

Step 4: Right-clickon the device. Click onProperties.

Step 5:Go to theDetailstab. Select the dropdown menu of Property and select Device Instance path.

Step 6: Select and copythe value of the Device instance path.

Step 7:Now, open Command Prompt as an Administrator.

Step 8:Enter the following command:

ReplaceDevice_Instance_pathwith the value you just copied to your clipboard. Make sure you paste it within the double quotes.

Step 8:Hit theenterkey once you add the command. Windows will remove the Bluetooth device.

12. Copy CMD Output to Clipboard

Depending on your command, CMD might give out an output with a large number of characters. Copying these characters can be difficult with the selection tool. Therefore, you can make use of this simple command to copy CMD output to the clipboard.

Run your desired command in the Command Prompt window whose output you want to copy. Then, use thepipe (|)character followed byclipto copy the output. Take a look at the example below.

13. Terminate Processes Using CMD

If you want to fully shut down an app or a process, here’s how you can terminate a process using thetaskkillcommand in CMD.

Step 1:Use thetasklistcommand to list all running processes and note down the name of the process you want to terminate.

Step 2:Use thetaskkillcommand followed by/IM(Image Name) and the process name to terminate it. At the end, add the/Fcommand to force the process to terminate.

14. Delete Temporary Files

It’s necessary todelete temporary fileson Windows to free up disk space, enhance system performance, and prevent potential issues caused by accumulated junk files.

Enter the following command to delete the local temporary (%temp% folder) files in Windows.

15. Delete Internet Cache Files

Depending on your web browser, enter the following command to delete the junk files created by websites and online data that is stored on your PC.

Bonus: Best CMD Shortcuts

While the above commands help you execute several tasks with ease in CMD, you also need to know a few shortcuts to use the tool itself efficiently. Here are ten keyboard shortcuts in CMD that can help you use the tool with ease!

Was this helpful?

Last updated on 15 May, 2024

The article above may contain affiliate links which help support Guiding Tech. The content remains unbiased and authentic and will never affect our editorial integrity.

More in Windows

7 Ways to Reduce How Much Data Your Windows 10 PC Uses

How to Fix Blurry Webcam or Laptop Camera on Windows 11

JOIN THE NEWSLETTER

Get Guiding Tech articles delivered to your inbox.

© 2024 Guiding Tech Media. All Rights Reserved.