Https://www.AiyeSamjhein.com
Windows 10 Tutorial #5 – Command Prompt (Part 2)
Contents of the page • Command prompt Windows - Must know Commands • Command Prompt - Commands o System-related commands ▪ Let's start with the command 'start' ▪ Current Date and time ▪ Systeminfo ▪ Check windows version ▪ Shutdown The PC ▪ Prank – How to shutdown a pc with a message? ▪ TaskList and Taskkill ▪ How to Open control panel from CMD ▪ Path Command ▪ Vol o Network Related Commands ▪ IPConfig ▪ netstat ▪ ping ▪ Tracert
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
▪ nslookup o Files & Folders Related Commands ▪ Commands for folder ▪ commands related to files ▪ How to create a file ▪ tree Command ▪ Command - 'More' • How do I memorize all the commands of cmd? o Help o /?
Command prompt Windows - Must know Commands
The command prompt is full of many useful and easy to follow, kinds of commands. We will work on these commands and explore how they work. Also, we will see that we need not remember these commands. A list of these commands is always there in the command prompt.
This command prompt tutorial is divided into the following four parts.
Part 1 – Cmd – Introduction, and Settings
Part 2 – Cmd – Must know Commands
Part 3 – Cmd – A useful List of Shortcuts
Part 4 – Cmd – Batch file programming
In part-I, we have covered Command prompt Windows 10 – Introduction and Settings. Let’s move on to part-2. If you have not gone through Part-1, I will suggest you have a look at it and then come back to join us on this page.
Note:- The Command Prompt is not case-sensitive.
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
It means whether you capitalize your commands or type in running letters, it will function in a similar way.
Command Prompt - Commands System-related commands
Let's start with the command 'start'
Open ‘cmd‘ > type — ‘start‘
It will open a new window. You can run a program or a command in this new cmd window separately.
Current Date and time
Open ‘cmd‘ > type — ‘time‘
Command Prompt will display the current system time in HH:MM: SS format.
Open ‘cmd‘ > type — ‘time /t‘
Displays time in HH: MM format.
Open ‘cmd‘ > type — ‘date‘. You can try date /t also.
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
Open the cmd as an administrator to change the system time, entering new values.
Hit ‘enter’ or press ‘Ctrl+C’ to come out of the time command console.
Systeminfo
To see all the information about your PC: type — ‘systeminfo‘ in the cmd without spaces.
This command shows all the necessary information about a system, like — no. of NIC card installed, OS installation date, BIOS version, OS version.
Check windows version
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
Type — ‘ver‘ to display the current OS version in the command console. type — ‘winver‘ to display the current OS version in a separate window.
Shutdown The PC
You can shut down a PC in many different ways from the command prompt.
1. type — ‘shutdown /i‘
A shutdown window will open. Shut down/restart your PC from here.
How to shut down a network PC from the command prompt type — ‘shutdown /i‘ and hit enter. From the window that appears, click on ‘Browse’.
Type the PC-name and click on the ‘find’ button. Select the PC name in the searched-list-window and click ‘OK’. Type the comment in the comment box. For example:-
“Hi, this the Administrator. Please, Save your work. The PC will shut down in 30 seconds. The written comment will appear on the target PC as a shut-down notification.
Note: - For shutting down a pc remotely you are supposed to know the name of the PC or IP address in a network. The admin password is also required.
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
Another shut down commands are:
‘shutdown /s‘ —> This command will directly shut down the PC.
‘shutdown /r‘ —> Use this command to restart the PC.
‘shutdown /a‘ —> To abort a shutdown. If a command for shut down or restart is already given, but you want to abort this shutdown then use this command.
‘shutdown /h‘ —> To hibernate the PC.
Prank – How to shutdown a pc with a message? Just for fun!
You can show this message on your friend’s PC.
For this message or any other genuine technical shutdown messages, follow these steps.
In the Command Prompt window:
Type — shutdown /s /t 300 /c “Hi User, This is your Machine talking to you. I am going to shut down as I am Tired. Byeee!!
Explanation:
‘shutdown /s‘ –> command for shutting down.
‘/t 300‘ —> time to a shut down in seconds. ‘/c‘ —> this command takes comment for a shutdown. You can type
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com comments such as ‘for maintenance’ or ‘for a system upgrade’ etc. type — ‘shutdown /?‘ for more options in the command shutdown.
TaskList and Taskkill
The command ‘Tasklist’ will show all the running tasks on a local or remote machine.
Try ‘tasklist /apps’ to see all the store apps and their associated processes.
‘Taskkill’ — This command is used to close a running task by process ID (PID) and image ID. type — ‘taskkill /pid 7344‘ this command will terminate the task with the process id 7344.
To see the PID use the command tasklist.
How to Open control panel from CMD type — ‘control’
This will open the control panel window. you can do any control panel related task from here.
Path Command
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
Press ‘Windows logo‘ key > type env > Environment variable window will open. You can see all the executable files path from the cmd window also.
To view all ‘paths’ from the cmd use the command ‘path’.
Vol
To check the disk volume label and a serial number of any drive(c:, d:, or e): type — ‘vol d:‘
Network Related Commands
IPConfig
To view windows Internet Protocol Configurations: type — ‘ipconfig‘ to display the IP configurations list, along with the IP address and mac address.
To get the mac address only: type — ‘getmac‘ without space. open a browser > go to google.com > and type ‘ipconfig’ in cmd > observer the whole list. type — ‘ipconfig/flushdns‘ to flush the local DNS cache. ( This command is useful in case your wi-fi adapter is showing network- connected, but you are unable to access the internet.)
Command prompt Part 1 - Introduction & Settings
Windows Tips and Tricks Part 1 - Folder Settings netstat
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
Network Statistics can be viewed in detail with the command ‘netstat’. type — ‘netstat – a‘ for a list of all the connections and listening ports. type — ‘netstat – e‘ for interface statistics (packets sent or received). type — ‘netstat – n‘ to display active connections in numerical values with process ids. type — ‘netstat – r‘ to display routing table. ping
Ping command is used to send the echo requested messages to the destination computer in a network and wait for its response. type — ‘ping www.google.com’ type — ‘ping 127.0.0.1‘ or ‘ping localhost‘ to check the serviceability of your machine TCP/IP. The address of your localhost is 127.0.0.1, this is called the loopback address also.
‘ping 127.0.0.1’ is the first step to check the serviceability of your machine’s nic card.
Tracert
To display the route of the packet from the source to destination PC, use the command ‘tracert’. type — ‘tracert www.google.com‘ it will show the route of the packet from your PC to google.com. nslookup
Name server lookup (nslookup) command is used to resolve the DNS (domain name server). In other words, use this command to check the name-server of a website against its name or IP address.
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
Similarly, while in a network, this command shows the name of any pc whose IP address is known or vice-versa.
For more commands of nsook up type ‘nslookup help’ or ‘nslookup /?’ set type=mx –> for mail eXchanger records.
set type=mb –> for mailbox domain name
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com set type=ns –> for DNS name server.
Files & Folders Related Commands
Commands for folder
NOTE: directories in cmd means folders. ‘md‘ or ‘mkdir‘ –> for creating new directory. ‘dir‘ –> to display a list of directories and files at the current location.
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
‘cd‘ or ‘chdir‘ –> to change directory. Use cd “directory-name” to go to that directory location. To get back by one location type –> ‘cd..‘. To go to another drive type the drive letter name.
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
‘rd‘ or ‘rmdir‘ –> for deleting an empty directory.
To rename a folder in cmd: ren “current folder name” “rename folder name”
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
The folder ‘my_file’ is renamed to ‘aiyesamjhein_file’.
commands related to files
How to create a file
There are two ways in which you create a file in cmd.
1. using ‘copy con’ command type — ‘copy con first_file.txt‘ start writing the content in the command prompt window. for example:
hi this is my first file in cmd.
press ‘ctrl+c‘ to come of the file and save it.
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
type ‘dir‘ to see the list of directories. You will find a file with the name ‘first_file‘ type –> ‘start first_file.txt‘, It will open in notepad.
2. using notepad. type –> ‘notepad second_file.txt‘ and press enter. the following window will open.
Press ‘yes‘. Start writing your content in the notepad. And go to > file > save as in the notepad to save this file. type ‘dir‘ again to see the file in the directory.
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
More commands related to files are:
‘move‘ –> move files from one directory to another.
‘ftype‘ –> to display or modify a file type.
‘type‘ –> to display the type of the file.
‘findstr‘ –> to search for a string of text in a file.
‘fc‘ –> to compare files. del “file-name” –> to delete a file. undelete “file-name” –> to undelete or restore a deleted file.
‘erase‘ –> to erase files from computer. tree Command type –> ‘tree‘ to display the graphical folder structure of a drive or path. try ‘tree /a‘ and ‘tree /f‘
‘deltree‘ –> to delete one or more files and folder.
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
Command - 'More'
When the file is too big to display in a single screen, use the command ‘more’ to display the content of a file inside the command prompt with one screen at a time. more “file-name”
How do I memorize all the commands of cmd?
You don’t need to memorize any commands of the command prompt. All the commands are written in the cmd window only. You just need to use two commands. Help open cmd type –> ‘help‘
A list of all the commands will display in your command prompt window with the required explanations. /? open cmd type –> any command and then suffix this command with ‘/?’
A list of all the commands available within that command will pop up with the required explanations. e.g.
‘md /?‘
Https://www.AiyeSamjhein.com Https://www.AiyeSamjhein.com
‘ipconfig /?‘
‘color /?‘ normally all the commands show help with ‘/?‘
This is the end of the Part-2 tutorial on cmd.
I hope you enjoy reading this tutorial. Comment below for any query, question or suggestion.
Like and subscribe to our channel “Aiye Samjhein” on YouTube.
Https://www.AiyeSamjhein.com