Best And Useful Command Prompt Tricks & Codes

Command Prompt Tricks & Codes

Like terminals in Linux and Mac Os, command prompt is also a command line interpreter application used in windows OS. A list of commands are provided as the input by users, then cmd executes the command to provide the accurate result. For an administrative access inside the pc, you’ve to run cmd with administrative privilages. Today we are going to learn some command prompt tricks with which you can present yourself as an expert in cmd or computers amongst others ( Viewers ).

First of all, open cmd with administrative privilages, if you don’t know then follow these simple steps:
1) Press Windows Button on keyboard.
2) Search for cmd.
3) Right click on the command prompt.
4) Then select run as administrator.

Now, be ready for the execution of commands. Follow along to know some secrets and tricks of the cmd. Be cautious, if you are beginner then check before you execute the command. A single mis-spell can cause a serious problem or the command may not execute because of the error. So, if you are ready to learn some Command Prompt Tricks, then let’s get started.

1) Become A Power User.

The first Command Prompt Tricks is the use of function key. Only using the function keys from your keyboard, you can be power user inside the cmd. Below is the list of function keys along with their properties.

Best And Useful Command Prompt Tricks & Codes
Best And Useful Command Prompt Tricks & Codes

F1: Pastes the last executed command (character by character)
F2: Pastes the last executed command (up to the entered character)
F3: Pastes the last executed command
F4: Deletes current prompt text up to the entered character
F5: Pastes recently executed commands (does not cycle)
F6: Pastes ^Z to the prompt
F7: Displays a selectable list of previously executed commands
F8: Pastes recently executed commands (cycles)
F9: Asks for the number of the command from the F7 list to paste

2) View a Drive’s Entire Directory Structure.
It’s a matter of surprise that only a single command can list your entire directory at once. If you’ve a lots of files and folders within your drive, then this command is just for you.
enter the command “tree” inside the cmd and see the magic yourself. This command will show you each and every directories under the specific drive. If you want to save the result in a text file then enter input the following command: tree /a > c:\export.txt

Best And Useful Command Prompt Tricks & Codes
Best And Useful Command Prompt Tricks & Codes

3) Change The Titlebar Name As You Desire.
This is not a permanent trick, but it’ll work perfect until you close the cmd. If you’re bored of the same title in the titlebar, then enter “title DESIRED TITLE”. For Instance, if you want
“Best Gaming Laptops”, then enter “title Best Gaming Laptops” this will change the current title into the new title “Best Gaming Laptops”. The title command is usually used to help give a custom appearance in script files and batch files.

Best And Useful Command Prompt Tricks & Codes
Best And Useful Command Prompt Tricks & Codes

4) Open the Command Prompt From Any Location.
If you’ve used cmd for a long time then you know, using cd/chdir becomes really frustrating at some case. It’ll be easy for short location but as the path increases, the job becomes irritating. So, if you are willing to open cmd from any folder or directory then just click on files and open cmd. It’s that much easy to do. Why not give it a try.

Best And Useful Command Prompt Tricks & Codes
Best And Useful Command Prompt Tricks & Codes

5) Create Wi-Fi hotspot.
Before opening the Command Prompt to execute the commands needed for this, you need to open Control Panel and find Change adapter settings in the Network and Sharing option. There, click on the connection you are using and click on Properties. Now find the sharing tab and check the option “Allow other network users to connect through this computer’s internet connection.”

Best And Useful Command Prompt Tricks & Codes
Best And Useful Command Prompt Tricks & Codes

Now open the Command Prompt with administrative privileges and enter the following command:

netsh wlan set hostednetwork mode=allow ssid=DesiredName key=DesiredPassword

After it is enabled, enter the following command to start the Wi-Fi hotspot:

netsh wlan start hostednetwork

Note: Restaring the pc will close the hotspot. You have to manually start it again by following above steps. But if you want to stop hotspot, then execute the following command:

netsh wlan stop hostednetwork

This method is only for windows 7/8/8.1 users. Windows 10 comes with hotspot function pre installed in itself so, you don’t have to bother to enter those commands manually.

6) View Your Network Adapter Information.
CMD facilitates it’s users by providing a list of commands, and by simply executing the command users will get the desired result. One of the command is “ipconfig”. Using the ipconfig command you can gather some basic onnfomations of your network connection. But if you want every possible information then execute the command by adding all i.e. ipconfig /all.

Best And Useful Command Prompt Tricks & Codes
Best And Useful Command Prompt Tricks & Codes

7) Find A Website’s IP Information.
Yes, you can find some valuable informations from cmd. By using the command nslookup and ping, you can acquire the IP address of a particular website. As an illustration, we’ll use thecosmotech.com as the website to get it’s ip address. Now execute following command:

nslookup thecosmotech.com

ping thecosmotech.com

Best And Useful Command Prompt Tricks & Codes
Best And Useful Command Prompt Tricks & Codes

Then the ip address will be in your front.

8) Get Information Of Any Command
If you need some information about the command you want to use then you can surely get help from the command prompt. But the process is a bit different, you can’t get a direct help from the command help. Instead, you have to put /? after the command. This is same as the help command. For Instance, let’s know something about the command “nslookup”. At first, type following commands,
nslookup/?

Then the cmd will provide you some informations related to the nslookup command. In my case, it prompted as follows:

Usage:
nslookup [-opt …] # interactive mode using default server
nslookup [-opt …] – server # interactive mode using ‘server’
nslookup [-opt …] host # just look up ‘host’ using default server
nslookup [-opt …] host server # just look up ‘host’ using ‘server’

Best And Useful Command Prompt Tricks & Codes
Best And Useful Command Prompt Tricks & Codes

Cmd is a very useful for windows users. Acquiring some information about cmd along with it’s usage can be of great help for normal users also. So, learn as much as you can and be safe.

Thank You for visiting us.
Visit again for daily updates and more tech related information.

-Thecosmotech.com