Command Line Tricks
you should try at least once in your life!
Encrypt Files Using Command Prompt
Encryption is a way to prevent others from taking a peek at your data, and it’s a really important part of ensuring (to some extent, at least), that your files are only yours. With this trick you can encrypt your files easily.
- Simply launch the Command Prompt, and change your working directory to the folder where your files are. This can be done by using the “cd” command.
- Once you’re done, type “Cipher /E“, and hit Enter. This will encrypt all the files that were inside the folder.
Note: If you try and open these encrypted files, they will open normally for you, however, any other user will not be able to view the files, unless they log in using your account. So make sure that you have a password set.
Change the Color of the Command Prompt Window
The default command prompt window can be boring. Well now you add colors and spice it up.
- Launch CMD and Right-click on the title bar
- Click on “Properties” and in the separate window that opens, click on “Colors”
- Here you can choose the colors for the screen text or background as well as for the popup text and background, and also change the transparency of the CMD window
- After you’re done choosing the most fitting colors for your personality, Click OK
Note: There are a lot of additional colors available, and you can check out the entire list by typing “help color”
Change the Title of the Command Prompt Window
When you open command prompt, you must have noticed that title bar reads “Command Prompt” or “Administrator Command Prompt” (If launched it with Administrator privileges).
Well this doesn’t matter unless you are working in multiple window and it becomes confusing! With this simple trick you can name your title bar so it would be easier for you to find the exact window you are looking for.
- Open Command Prompt, and type “title”, followed by the text that you want the Title bar to read.
- Hit Enter, and you will see the Title of the cmd window change to the text that you entered.
Note: The title changes back to “Command Prompt” once you quit cmd and relaunch it.
Create a WiFi Hotspot
You can use command prompt to create hotspot to share your internet with multiple devices without the need of third party applications. You can do it with few simple steps
- Launch Command Prompt, and type “netsh wlan set hostednetwork mode=allow ssid=HotspotName key=Password“. Replace “HotspotName” with the name that you want for your WiFi hotspot, and replace “Password” with the password you want to set. Hit enter.
- Next, type “netsh wlan start hostednetwork” and hit Enter, and your WiFi hotspot will be broadcast, and other devices will be able to connect to it.
Note: If you want to stop broadcasting your WiFi hotspot, simply use the command “netsh wlan stop hostednetwork”.
Hide Folders using Command Prompt
You could hide a folder with checking the hidden option in properties but it does not completely hide your files. Using this Cmd trick you will be able to hide your files completely and explorer won’t be able to display them.
- Launch Command Prompt, and navigate to the directory where your target folder resides.
- Type “Attrib +h +s +r folder_name“, replacing the “folder_name” with the name of the folder that you want to hide, and press Enter.
- You can now check that the folder is indeed hidden inside Windows Explorer and can not be seen by anyone.
- To unhide the folder, you can use the command “Attrib -h -s -r folder_name“.
Note: Hidden folders can be viewed using the cmd command “dir /AH”.
Copy Command Output to Clipboard
If you have ever tried to copy stuff off the Command Prompt, you must have realized that it is exceedingly difficult, not to mention un-intuitive. With this simple trick you can copy your output.
- Launch Command Prompt and type the command that you want to copy the output for, followed by “| clip“. For example, I’m using the command “ipconfig | clip“. Hit Enter, and you will see that the cmd window shows no output.
- Open a text editor, example Notepad, and press Control + V, and you can simply paste the output of the command directly inside Notepad.
List all Installed Programs
Another cool trick on the Command Prompt involves listing out all of the Windows 10 apps and programs that are installed on your PC. This is particularly helpful if you need to uninstall a program using the Command Prompt.
- Launch Command Prompt, and type “wmic product get name“.
- Hit Enter, and you will see a list of all the programs that are installed on your PC.
Note : If you want to uninstall “wmic product where “name like ‘%NAMEOFAPP%’” call uninstall /nointeractive”
Open CMD Window Inside a Directory
Let’s face it, the way Windows handles changing directories using the “cd” command is rather weird. Fortunately, there is a simple way to open Command Prompt windows inside a directory so you don’t have to change directories.
- Open the directory in Windows Explorer. In the address bar, type “cmd”, and hit Enter.
- A command window will open inside the directory you had opened in Windows Explorer.
Generate Battery Health Report
Windows 10 lets you track vital stats related to the battery’s health by maintaining data related to the battery. This includes stats like factory specifications, full battery capacity, and the current capacity and these are updated with each session.
- Launch Command Prompt as an Administrator or change directory using cd C:\Windows\System32
- Enter command powercfg/energy
- The system will take 60 seconds to analyze and then generate a report in form of an HTML documents
- To access the report, you can find the file stored as C:\Windows\system32\energy-report.html
Hope you enjoyed. Share with your geeky mate’s.