Command Line Tricks

you should try at least once in your life!

Random Image from the Internet

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.

  1. 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.
  2. 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.

  1. Launch CMD and Right-click on the title bar
  2. Click on “Properties” and in the separate window that opens, click on “Colors”
  3. 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
  4. 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.

  1. Open Command Prompt, and type “title”, followed by the text that you want the Title bar to read.
  2. 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

  1. 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.
  2. 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.

  1. Launch Command Prompt, and navigate to the directory where your target folder resides.
  2. 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.
  3. You can now check that the folder is indeed hidden inside Windows Explorer and can not be seen by anyone.
  4. 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.

  1. 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.
  2. 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.

  1. Launch Command Prompt, and type “wmic product get name“.
  2. 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.

  1. Open the directory in Windows Explorer. In the address bar, type “cmd”, and hit Enter.
  2. 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.

  1. Launch Command Prompt as an Administrator or change directory using cd C:\Windows\System32
  2. Enter command powercfg/energy
  3. The system will take 60 seconds to analyze and then generate a report in form of an HTML documents
  4. 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.




Tried Everything. Coding to Visual Arts. Still Figuring Out. Know Further

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

OWASP 2020

We Answer 8 Burning Questions| Beginner’s Guide to Civic Hacking

Cybersecurity is everyone’s responsibility — Cybersecurity from a Chief Human Resource Officer…

{UPDATE} Wynn Slots - Las Vegas Casino Hack Free Resources Generator

Self-Hosted “Hide My Email” Service on AWS with CDK

Unveiling the KlayStarter Season 1

Exnetwork Invites You to Dive into a Cyberpunk Metaverse with Reign of Terror

Russian ‘Evil Corp’ Was Behind a Decade of Hacks, U.S. Says

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Enos Jeba

Enos Jeba

Tried Everything. Coding to Visual Arts. Still Figuring Out. Know Further

More from Medium

Git Commands Should Know By Every Developer

Linux Basic Commands: Part 1

Most Important Things to Learn other than Coding…

Linux Fundamental Part 1 | TryHackMe