Command Prompt is an integral part of Windows since its origin. Though the Command Prompt terminal is hidden under the covers in Windows, it is still useful to run scans, locate some particular files fast and so many ways more. Then some other cool things are possible only by using the Command Prompt, those are not possible using the Graphical User Interface (GUI) of Windows 10. Here are the top 20 command prompt codes to do stuff that is reserved for the cmdlet.
Trick 1 – Customizing the color of the terminal
You can easily customize the color of the Command Prompt terminal. Follow these steps to do so.
1. Type “cmd” in the search box.
2. Then, right-click on the “Command Prompt” and click on the “Run as administrator“.
3. When the Command Prompt opens up, right-click on the title bar of the Command Prompt terminal and click on the “Properties“.
4. Here, go to the “Colors” tab at first.
5. Click on the “Screen Background“. Set the color of the background as you prefer from the colors given in the box.
6. Additionally, you can toggle the ‘Opacity’ level that allows the terminal’s transparency level.
7. Same way, click on the radio button beside the “Screen text“. Then, select the color of the text according to your preference.
8. If you want to toggle the font size, select the “Font” tab.
9. Here, you can select the type of font you want, size of the font you prefer. Adjust these particulars according to your preferences.
10. Finally, go to the “Options” tab.
11. You can easily adjust the font in this section. Don’t forget to click on “Ok” to save this modification.
Now, check out your new terminal.
Trick 2 – Encrypt files with CMD
You can encrypt your files with Command Prompt.
1. Open the Command Prompt as an administrator.
2. Then, use the “cd” command to navigate to the folder you want to encrypt. Copy-paste this command, modify it, and hit Enter.
cd folder location
[
Example –
Change the “folder location” with the folder location you want to encrypt.
cd C:\Users\Sambit\Desktop\New folder
]
3. Then, execute this encryption command to encrypt the folder you want.
cipher /E
You will see the encryption process is being done. Wait for the process to be complete.
You can manually check whether the folders are encrypted or not.
Trick 3 – Changing the prompt
The prompt appears at the front of the terminal command line. Usually, it is “C:\Windows\System32“, which appears to be pretty basic and boring. What if it shows your name? You can do it this way –
1. Open up the Command Prompt window.
2. Then, paste this command and hit Enter to alter the prompt.
prompt any term you prefer
[
Example – We want “@geekpage” as our prompt. So, this is the command –
prompt @geekpage
]
Now, you will see the prompt as you want.
Further, there are other terms you can enter to set different terms as your prompt. Like to set the date as the prompt, you have to execute this command –
prompt $T
See the screenshot for more details.
If you want to set it back to the norma, just close and re-launch the Command Prompt.
Trick 4 – Changing the title
Besides the prompt, the Command Prompt title on the title also looks boring. You can alter it also!
1. Open the CMD terminal, it isn’t open yet.
2. Just modify this command as you want it and execute it.
title any name as you like
[
Replace the ‘any name as you like with any name you prefer.
Example – We want to set the title as “TheGeekPage“. The command will look like this –
title TheGeekPage
]
You will notice the change in the title of the Command Prompt.
Trick 5 – Watch the Star Wars movie
Have you watched the Star Wars movie on the terminal? Yes. Command Prompt can do that too.
You will need an internet connection for this and this works very well with IPv6 connectivity. You must have telnet enabled on your Windows computer for this.
1. First of all, open up the Command Prompt terminal with administrative access.
2. Then, just paste this command and hit Enter.
telnet towel.blinkenlights.nl
Command Prompt will connect with the telnet server and the 20 minutes movie made with ASCII characters will start to play!
Trick 6 – Function keys are unique shortcuts
The Function keys on your keyboard (ranging from F1 to F9) are some very unique shortcut keys on the Command Prompt.
We are going to list all the functionalities of the keys and discuss the functionality of the F7 key in depth.
F1: If you tap and hold this key, you can see your last commands one-by-one.
F2: This can copy any command to a specified key
F3: You can retype the previous lines
F4: Auto-deletes the current command up to a specified character.
F5: Almost same as the F3 key, but lets you cycle through previous commands.
F6: This put the EOF indicator into the CMD terminal.
F7: You will see a list of previously entered commands.
F8: Similar to F5, but doesn’t stop at the end of your command history in the session. Instead, it goes all the way to the start.
F9: Enters a previous command by entering a number associated with that line.
Try out these exciting shortcuts that can increase your productivity significantly.
Trick 7 – F7 key shows the history
The F7 key shows the history of the commands you have entered.
1. Open the terminal, if you haven’t opened it yet.
2. Press the F7 key and see all the commands you have entered in a highlighted pane.
3. If you want to copy a command, just place your mouse on the command, select it with the mouse, and press the Ctrl+C keys together.
4. Now, press the “Esc” key to close the pane.
5. Next, you can press the ‘Ctrl+V‘ keys together to paste the command.
This way, you can use any of the previously entered commands and edit them.
Trick 8 – Copy to clipboard
There is another hidden but useful command. This allows you to copy the output results in the clipboard.
1. Open the Command Prompt terminal with administrative rights.
2. Now, execute your command appended by “|clip” in the command line argument.
Example –
Suppose you want the IP configuration of the network connectivity. So, you have to run the “ipconfig” command.
Now, you have to copy the IP configuration to the clipboard. So, execute this command –
ipconfig |clip
Minimize the Command Prompt.
3. Open any text editor or where you want your output.
4. Press the “Ctrl+V” to paste the output.
This way, you can use the output as you prefer.
Trick 9 – List all the installed devices at once
If you want to view only or troubleshoot the installed device drives on your terminal, this command is just for you.
1. Open the terminal with administrative privileges.
2. Then, type this command and hit Enter.
driverquery /FO list /v
This will list all the installed devices on the terminal. You can see the ‘Module Name:’, ‘Driver Type:’,
3. Now, if you want this output as a text output, execute this code.
driverquery > C:\Users\%username%\Desktop\driver.txt
This will output the result in the ‘driver’ text on the Desktop.
Trick 10 – Hide folder in the terminal
It is quite tricky to hide folders within the File Explorer using regular traditional methods. But you can do it easily using the Command Prompt terminal.
1. Launch the Command Prompt terminal.
2. Then, navigate to the directory where the folder is located using the “cd” command.
cd folder location
[
Example – If the ‘New folder’ in the “C:\Users\Sambit\Desktop” location, then you have to execute this code –
cd C:\Users\Sambit\Desktop\
]
3. Now, copy-paste this code in the terminal, modify it accordingly and execute the command to hide the folder.
Attrib +h +s +r folder_name
[
Example – Replace the “folder_name” with the name of the folder you want to hide.
Like, if we are going to hide the “New folder”, the command will be –
Attrib +h +s +r New folder
]
4. Similarly, if you want to just unhide the folder again, execute this code.
Attrib -h -s -r folder_name
[
Replace the “folder_name” with the folder name you are supposed to unhide.
Attrib -h -s -r New folder
]
This will unhide the folder.
Trick 11 – See all the installed programs
Do you want to check all the apps installed on your computer? You can easily do it with a simple command.
1. Open the CMD terminal on your computer.
2. Just, type these commands one by one and hit Enter to execute it.
wmic
product get name
You will see the list of applications installed on your computer.
Uninstalling an application –
1. You can uninstall an application using the terminal.
2. Execute this command and hit Enter.
product where name="program name" call uninstall
[
NOTE – Just replace the “program name” with the name of the application you want to uninstall.
If you are trying to uninstall the “Zoom” app, the command will be –
product where name="Zoom" call uninstall
]
This will start the uninstallation process.
Trick 12 – Create folders with reserved names
There are some folder names that you can’t use in Windows. Like if you are trying to create a folder named “con” or “aux“, you just can’t do it! Windows will throw up an error message and stop you from doing that. You can do it using the Command Prompt.
1. Open the terminal with proper administrative rights.
2. After that, you can create the “con” folder with the following command.
md con\
3. Similarly, you can create the “aux” folder using the same ‘md’ command in the terminal.
md aux\
After executing these codes, you will see and use these folders as usual.
Trick 13 – Generate a battery report for your device
You can generate a detailed battery report for your device using the CMD. This report will be created in HTML format.
1. At first, launch the Command Prompt terminal as an administrator.
2. Then, go to this location using the ‘cd’ command, if you aren’t there already.
cd C:\Windows\System32
3. Once you are there, type this command in the terminal and hit Enter to execute it.
powercfg/energy
This process will take a few seconds to analyze the battery parameters and export the same to an HTML document.
4. Press the Windows key+R to open up a Run terminal.
5. Then, paste this location and hit Enter.
C:\Windows\system32\energy-report.html
6. You may several browser options to choose from.
7. Just click on “OK“.
Choose any browser you want.
Energy-report will open up in a browser. You can analyze the battery performance and the battery capacity settings, power warnings, and various errors in battery settings.
Trick 14 – Merge multiple files
You can merge two different images into a single image file. You will need to have the multiple files that you want to merge in a single folder.
1. At first, open the Command Prompt terminal.
2. You can navigate to the location of the folder where the files are.
cd folder location
[
Example – If the ‘New folder’ in the “C:\Users\Sambit\Desktop” location, then you have to execute this code –
cd C:\Users\Sambit\Desktop\New folder
]
3. Then, copy-paste and hit Enter two merge two files into one file.
copy filenmae1.extension + filename2.extension mergedfile.extension
[
Just replace the ‘filename1.extension’ and ‘filename2.extension’ with the files you want to merge. Finally, replace the “mergedfile. extension” with the name of the merged file name that you want.
Example – Here we have merged the “first.txt” and the “second.txt” file into a “third.txt” file. ]
This will merge two text files into a single one. You will see the “1 file (s) copied.” message once the merge is complete.
Trick 15 – Hide the secret RAR file as an image
You can merge two different types of files into a single type of file. You can easily use this technique to hide secret RAR files in an image file.
Before trying this trick, you have to put both the files in a single folder.
1. Open the Command Prompt terminal.
2. Again, navigate to the folder where the files are.
cd folder location
[
Example – If the ‘New folder’ in the “C:\Users\Sambit\Desktop” location, then you have to execute this code –
cd C:\Users\Sambit\Desktop\New folder
]
3. Then, execute this command to merge the zip file and the image file.
copy /b <RAR_filename>.rar + <image_filename>.<extension> <result_filename>.<extension>
[
NOTE – Simply replace the “<RAR_filename>.rar” and the “<image_filename>.<extension>” with the actual file names and extensions that you want to are trying to merge.
Additionally, you can give any name to the resultant “<result_file>” image file.
Example – We have merged the “fix_update.rar” file and the “beach.jpg” file to the “Hidden.jpg“.
copy /b fix_update.rar + beach.jpg Hidden.jpg
]
Warning– If you jumbled up the order of appearance in the command line, you won’t be able to recover your RAR package. In simpler words, if you put the image file first and then, put the RAR package, you will lose the RAR package.
This will merge the file into a single entity.
4. Now, go to the directory where these files are.
5. Then, just delete the RAR file.
That’s it! The RAR package is hidden inside the image file that you have just created.
If you open the image file with an image processor, you will see the image only. But, if you extract the file using WinRAR or any other tool, you will get your sensitive RAR package back.
Trick 16 – Play a TORPG game
You can even play a Text Only Role Playing Game (TORPG) from your terminal. If you are an RPG fan, you will love this!
1. Open the CMD terminal.
2. Next, type this command in the terminal and hit Enter.
telnet ateraan.com 4002
3. Now, you will see that the game has started.
Put your name and enjoy the game!
Trick 17 – Set the CMD to launch as an admin
If you use the CMD a lot, you know how bothersome is to launch the terminal with administrative rights. You can easily configure to launch the terminal as an administrator.
1. Click on the search box beside the Windows icon and type “cmd“.
2. Then, right-click on the “Command Prompt” and click on “Open file location“.
3. This will open up the System Tools folder. Just right-click on the “Command Prompt” and click on “Properties“.
4. Go to the “Shortcut” section.
5. Further, tap on the “Advanced…” to open up the Advanced Properties.
6. Just check the “Run as administrator” box.
7. Finally, click on “OK“.
8. Finally, click on “Apply” and “OK” to save the settings.
Now, normally open the Command Prompt. Simply search it using the search bar and hit Enter. It will open with administrative rights.
Trick 18 – Stop command execution in midway
Some scanning commands (like sfc, dism scans) take up a significant amount of time. If you want to abort a command execution midway, go this way –
While executing a scanning command or if you are stuck in a recursive loop, just press the “Ctrl+C” keys together to stop the command execution midway. You will be immediately redirected to the prompt.
Trick 19 – Find more info about the commands
If you want to know about commands a bit more or if you want to explore other functionalities of a utility, this will help you.
1. Open the Command Prompt terminal with administrative rights.
2. Just type the syntax of the command appended with a “/?“.
Suppose you are trying to know about the SFC scan, then the command will be –
sfc /?
You will see the information about the command with variable arguments with examples.
Trick 20 – Clear the Temp folder
You can empty your Temp folder from the terminal itself. No more emptying the Temp folder by yourself.
1. Open the Command Prompt terminal with administrative rights.
2. Once it opens up, use this command to empty the temp folder at once. Just paste this in the terminal and hit Enter.
del /q /f /s %temp%\*
This command will clear the Temp folder on your computer.
3. If you want to delete all the Temp files irrespective of the location of the files, just execute this command on your computer.
del /s /q C:\Windows\temp\*
4. If you want to execute both of these commands at the same time, write this command and hit Enter.
del /q /f /s %temp%\* && del /s /q C:\Windows\temp\*
After executing these commands, the Temp folder will be empty.
You can create a batch file containing these codes to clear the Temp files and even further, you can automate the script to run automatically.
Bonus Tips –
There are some other useful commands that you can try out.
1. List of telnet commands –
A. Play Chess –
You can play chess on an online server. Just use this command –
telnet fics.freechess.org 5000
B. Talk to AI Psychotherapist–
You can even talk to an AI Psychotherapist on a chat-based telnet client.
1. Open the terminal with administrative rights.
2. Then, type this command and hit Enter.
telnet telehack.com
3. You will see a list of commands, just type “eliza” and hit Enter.
Eliza the AI Phsycatrist will start to talk with you. State your problem and it will try to resolute it.
C. Check the Weather forecast –
Use this command to check the weather forecast from the command line.
telnet rainmaker.wunderground.com
2. Use the new Windows Terminal –
You can use the new Windows Terminal instead of the older CMD terminal, which offers many customizations. Even you can use the PowerShell console and any other terminal at the same place.
If you want to take an in-depth look at the Windows Terminal, try this article.