Command Prompt is the most powerful Windows tool and a goldmine of hidden functionalities for a power user. From managing your network to managing installed programs to encrypting your files and folders, you can do so much using simple commands on Command Prompt.
Here are a few lesser-known uses of Command Prompt that will transform your Windows OS experience.
Almost all of the following commands require administrative privileges to perform their actions. So, ensure that you launch the Command Prompt with administrative rights.
How to master the Windows Command Prompt — The ultimate command line cheat sheet
The Windows command prompt is a powerful tool you can leverage with these helpful prompts.
16 Copy command output to clipboard
Save results quickly
Sometimes, you may want to copy the Command Prompt's command output for your reference or analysis, such as when using the ipconfig command. However, selecting and copying anything on the command line window is challenging, especially the large outputs. That's where the clip command will help you. Adding it to the end of any command will send the output directly to your clipboard. You can then paste it into a text editor app.
For example, I need to save my system information on my hard disk. So, I simply added the | clip to the systeminfo command and then pasted the output into a text file. This is a pretty effective way to document so many valuable command outputs.
15 Truly hide a folder or file
Make folders invisible, unlike what Windows does
Windows has a built-in option to hide folders and files from a regular view. However, that is practically useless because a simple change in the View settings makes all the hidden folders visible to everyone. That's where this simple Command Prompt folder hiding command does wonders. It completely hides a folder or files that won't show themselves even if the "Show Hidden Files" option is activated. You can easily put all your sensitive directories or files out of sight, and that too, without any help from a third-party app.
Here's how:
- First, right-click on the file or folder that you want to hide and choose the Copy as path option.
- Launch Command Prompt and use the attrib +h +s command to hide the folder. Instead of paste the path that you copied. For example, attrib +h +s "E:\sample\HideThisFolder"
- To make the folder/file visible again, use the attrib -h -s "E:\sample\HideThisFolder" command.
Remember the folder or filename when hiding them. Otherwise, it'll be hard to unhide them.
14 Generate a list of installed programs
Know what apps are on your system
If you would like to know and export the list of all the programs installed on your system, you can do that using Command Prompt. This list becomes important when troubleshooting your PC or during system audits. The command lists the installed apps along with their versions. You can also export this list as text or CSV file for sharing or storing purposes.
- Open the Command Prompt and use the wmic product get name,version command. Depending on the number of programs installed on your system, it could take several seconds or even a minute.
- The command will list all the installed apps with the product version in the descending order of their installation dates.
- Further, adding >InstalledApps.csv to the command will create and save the file in the user account folder. Alternatively, you can copy it to the clipboard by adding the | clip command and paste it into a text file.
13 View your system's driver details
Keep track of crucial drivers
This is similar to creating a list of installed apps. With this command, you'll be able to get detailed information about all the drivers installed on your system. The list tells you about the driver type when it was installed, and the files associated with it. These can be handy when troubleshooting driver-related issues or verifying whether your system drivers are updated.
Just open the Command Prompt and use the driverquery command. For even more details, add the /v to the command. For this also, you can generate a text or CSV file or just copy the output and paste it into a text document.
12 Find large files on your system
Identify space hogs
If you are struggling with low disk space on your system, you don't need a dedicated third-party tool to analyze your drive for the huge files that are hogging your valuable disk space. A simple single-line Command Line command will do the trick. So, for example, if you would like to find out how many files on your system are greater than 1 GB in size, use this command: forfiles /S /M *.* /C "cmd /c if @fsize gtr 1073741824 echo @path"
Let me break down the command for you:
- forfiles is a Windows command to take actions on files in a folder
- /S instructs the forfiles to also check the subdirectories
- /M specifies the search pattern. The *.* instructs to check for all names and extensions
-
/C "cmd /c if @fsize gtr 1073741824 echo @path": This specifies the command to be executed on each file that matches the search criteria. Here's the breakdown of this sub-command:
- cmd /c: Executes the command string that follows it.
- if @fsize gtr 1073741824: Checks the size of the file (@fsize) and compares it to 1,073,741,824 bytes (1 GB). gtr stands for "greater than." If the file size is greater than 1 GB, the command inside the if condition will execute.
- echo @path: Outputs (displays) the full path of the file that satisfies the condition.
Basically, running this command will display the exact addresses of all the files that are greater than 1GB in size present on your system drive. It's an excellent command for pinpointing unnecessary space-hogging files so that you can locate and delete them.
Just a heads up. It could take hours for this command to execute fully, depending on the size of your system drive and also the processing speed. You can then separately run this command on your every other drive, if applicable.
11 Create a Wi-Fi hotspot
Share your internet connection
You can turn your Windows laptop into a wireless hotspot with just a few CMD commands. It can be useful in situations when only limited devices are allowed to connect to a router or when you temporarily need to extend the internet access.
- Begin by setting up a hosted network with the following command: netsh wlan set hostednetwork mode=allow ssid=YourNetworkName key=YourPassword. Replace "YourNetworkName" with your desired Wi-Fi name and "YourPassword" with a secure password.
- Once set up, start the hosted network with: netsh wlan start hostednetwork
This functionality is particularly useful for sharing your connection with multiple devices during travel or emergencies. Paired with Internet Connection Sharing (ICS), it becomes a powerful workaround for creating temporary wireless networks with minimal effort.
10 Access your Wi-Fi password
Retrieve saved credentials
If you forget your Wi-Fi password, you don't have to strain your brain to remember it because CMD will help you recover it from the saved network profiles. Use the netsh wlan show profile name=YourSSID key=clear command. Replace YourSSID with your Wi-Fi name.
Next to the "Key Content" section, you'll find the saved password for the specified network. This command is a lifesaver for managing multiple Wi-Fi connections without repeatedly asking for credentials.
9 Test your internet connection
Measure connectivity
If you suddenly experience a slow internet connection or no internet at all, Command Prompt makes it easy to check the connection to a specific server, for example, google.com. Just use the ping google.com command. The result will show the packet loss and latency, helping diagnose issues like slow speeds or dropped connections.
For continuous monitoring, you can add the -t flag to keep the ping running indefinitely: ping -t google.com
Press Ctrl + C to stop the process and review the summary.
8 Get detailed network information
Diagnose network issues
Command Prompt will give you an overview of your system's network settings and activity using the ipconfig /all command if you have to perform a network diagnostic. This command will provide every detail, such as the IP addresses, MAC addresses, DNS, and DHCP configurations. It will help you identify the misconfigured network settings and the root cause of the network problem on your PC.
You can add the | clip command at the end to transfer the output to your clipboard or just create an output file using >.
7 Encrypt your files and folders
Protect sensitive data
Want to secure your sensitive data by encrypting it? Command Prompt lets you do that. It includes a simple command to encrypt files and folders that other users won't be able to access. By other users, I mean the other user account on your PC. To encrypt a folder or file, use: cipher /e "C:\path\to\file" command. If you have encrypted a folder, all the contents inside will also get encrypted. If someday you want to decrypt your encrypted folder or files, use the cipher /d "C:\path\to\file" command.
