9 Basic Windows Commands you should know for Daily Uses
Today Technology Routine has picked up 9 Basics Microsoft windows commands you should know for daily uses.
1. WMIC( Windows Management Interface Command)
WMIC is the abbreviation of Windows Management Interface Command, is a simple command prompt tool that returns information about the system you are running it on. WMIC extends WMI for operation from several command-line interfaces and through batch scripts.
Common WMIC queries
How To Find Out The Model Of Your Computer ?
In order to find out the model name of a machine using WMI, simply follow the guide below:
Go into a command prompt and Type in
>WMIC ComputerSystem GET Model
then, you will get:
Model 20C5004AUE
How to Find Your Computer Name ?
>wmic computersystem get name,systemtype
output:
Name : yourcomputername
SystemType : x64-based PC
How to Find the Serial Number of your computer ?
>wmic bios get serialnumber
One more command will help you to identify the Serial Number of your Computer
>wmic csproduct get identifyingnumber
How to Find the MAC Address of Your Computer ?
>wmic nic get macaddress,description
How to Check Your Motherboard Model Number ?
>wmic baseboard get product,Manufacturer,version,serialnumber
How to check physical memory of your computer ?
>wmic COMPUTERSYSTEM get TotalPhysicalMemory
How to get all running programs and memory usage ?
>wmic process get workingsetsize,commandline
This lists the program and the memory usage
How to get partition name size and type ?
>wmic partition get name,size,type
How to get computer manufacturer ?
>WMIC COMPUTERSYSTEM GET MANUFACTURER
output : HP
How get mode version ?
>wmic csproduct get version
output: Type1ProductConfigId
System Information
This program can also provide details on many other aspects of your system.
>wmic service list brief
>wmic process list brief
>wmic startup list brief
will list your installed software, services, running processes and Windows startup programs, for instance.
Process Management
Using WMIC you can manage your computer process like, close all the instances of a particular program. For example, if you want to shut down all FireFox windows, for instance, then the command:
>wmic process where name="firefox.exe" call terminate
Write WMIC output to file
In order to do so, simply use the /output: "< filepath & name >" switch. Insert this right after the wmic, but before any other part of the command: for instance, wmic /output:"C:\output.txt" , then the output will export the output.txt file.
2. SFC (System File Checker)
The sfc command is a Command Prompt command that can be used to verify and replace important Windows system files. Many troubleshooting steps advise the use of the sfc command.
System File Checker is a very useful tool to use when you suspect issues with protected Windows files, like many DLL files.
Sfc Command Examples
Here are some examples of the different ways you can use this command:
Scan and Replace All Corrupt Files
sfc /scannow
In the above example, the System File Checker utility is used to scan and then automatically replace any corrupt or missing system files. The /scannow option is the most commonly used switch for the sfc command.
Repair a Specific File
sfc /scanfile=c:\windows\system32\ieframe.dll
The sfc command above is used to scan ieframe.dll and then repair it if an issue is found.
Scan a Different Windows Installation
sfc /scannow /offbootdir=c:\ /offwindir=c:\windows
In the next example, protected Windows files are scanned and repaired if necessary (/scannow) but this is done so with a different installation of Windows (/offwindir=c:\windows) on a different drive (/offbootdir=c:\).
Scan Everything, But Don't Repair
sfc /verifyonly
Using the sfc command with the /verifyonly option, System File Checker will scan all protected files and report any issues, but no changes are made.
3. MRT (Malicious Software Removal tool)
The Microsoft Malware Removal Tool: A Targeted Windows Malware Scanner
The Microsoft Malicious Software Removal Tool, then, is more targeted. It only removes a concise list of the most prevalent malicious software and is designed to do so while the malware is active
How to Run the Microsoft Malicious Software Removal Tool via Command Prompt
If you can’t access your PC’s GUI because you have been locked out of your system by the malware, you can use the command-line instead.
Open Command Prompt
If you can still access the start menu, press Start and then type “CMD”. With Command Prompt selected, click “Run as administrator” on the right-hand side of your Start Menu.
If you can’t access Command Prompt via the Start Menu, follow our guide to access it via Advanced Startup Options.
Run the Microsoft MRT command
In your command prompt window run one of the following commands:
Command | Description |
MRT /F | Run a forced full scan with the MSRT UI |
MRT /F /Q | Run a forced full scan without the MSRT UI |
MRT /F :Y | Run a forced full scan via the UI and automatically clean files |
MRT /F:Y /Q | Run a forced full scan without the UI and automatically clean files |
That’s all for this one. Now that the Windows malware scanner has done its work, you may want to check if Windows Defender has been disabled and turn it back on. You should also consider turning on the hidden adware blocker for extra protection.
4. DISKPART
The diskpart is one of the oldest tools in the Windows operating system that handles a wide range of disk management jobs
Diskpart Used to create, delete, clean or extend disk partitions
To create a partition:
- At a command prompt, type: diskpart
- At the DISKPART prompt, type list disk (Note the drive number you wish to manipulate.)
- At the DISKPART prompt, type: select disk 0(This selects disk to edit; make sure to type in the disk number from step two.)
- At the DISKPART prompt, type create partition primary size=10000(The size parameter refers to the size in megabytes. In this case, 10000 equals 10 GB. Change the word primary to extended to create an extended partition. If you do not set a size, then all available space on the disk will be used for the partition.)
- At the DISKPART prompt, type assign letter=D(Choose an unused drive letter.)
- At the DISKPART prompt, type exit
- From the command prompt, use the formatcommand, or the Disk Management utility in Windows or any disk format tool to format the drive. You would typically use the NTFS file system during the initialization process.
To extend a partition:
- Verify that contiguous free space is available on the same drive and that free space is next to the partition you intend to extend with no partitions in between. Be sure you have a full backup before trying this method.
- At a command prompt, type diskpart
- At the DISKPART prompt, type select disk 0(Selects the disk.)
- At the DISKPART prompt, type select volume 0(Selects the volume.)
- At the DISKPART prompt, type extend(If you do not set a size, then diskpart will use all available space on the disk.)
- At the DISKPART prompt, typeexit
To delete a partition:
- At a command prompt, type diskpart
- At the DISKPART prompt, type select disk 0 (Selects the disk.)
- At the DISKPART prompt, type list partition
- At the DISKPART prompt, type select partition 4 (Selects the partition.)
- At the DISKPART prompt, type delete partition
- At the DISKPART prompt, type exit
To create a simple volume:
- At a command prompt, type diskpart
- At the DISKPART prompt, type select disk 0(Selects the disk.)
- At the DISKPART prompt, type create volume simple size=1000 (The size is in megabytes.)
- At the DISKPART prompt, type exit
To clean a disk:
- At a command prompt, type diskpart
- At the DISKPART prompt, type select disk 0
- At the DISKPART prompt, type clean all
- At the DISKPART prompt, type exit
5. TASKLIST AND TASKKILL
This Used to list running tasks and end those tasks.Generally we manage processes through the Task Manager but it does not allow killing multiple processes at a time.
Use Of Tasklist Command
Use of Taskkill
The Tasklist command shows all the running processes in your system. Then you can easily kill this process using the Taskkill Command.
For example to kill i_view32.exe, run the command as.
Taskkill /F /IM dwn.exe
Where /F is used to kill the process forcefully. And you can also kill the process using the Process Id shown by the tasklist command. For example to kill process 1032.
Taskkill /PID 4 /F
To kill multiple processes simultaneously run the following command.
Task /PID 4 104 /F.
6. SHUTDOWN
- Type the following command to gracefully shut down the device after one minute and press Enter: shutdown /s
- Type the following command to shut down the device after a specific time and press Enter:shutdown /s /t TIME In the command, replace TIME for the second to wait before the device begins the shutdown process.For example, this command turns off the computer after five seconds:
shutdown /s /t 5,
Quick tip: You can also use "0" for the time for shutdown immediately.
- Type the following command to shut down the computer without waiting or warning and press Enter:shutdown / p
- Type the following command to shut down, forcing all apps to close without warning, and press Enter: shutdown /s /f
- Type the following command to restart the device and press Enter:
shutdown /r
- Type the following command to restart the device after a specific time and press Enter:
shutdown /r /t
Time in the command, replace TIME for the second to wait before the device begins the restart process.For example, this command restarts the computer after five seconds:shutdown /r /t 5,
Quick tip: You can also use "0" for the time to restart the device immediately. - Type the following command to restart without waiting or warning and press Enter:
shutdown /r /p
- Type the following command to shut down, forcing all apps to close without warning, and press Enter:
shutdown /r /f
From session 5 ,After you complete the steps, the computer will restart according to the options you specified in the command
- Type the following command to shut down, forcing all apps to close without warning, and press Enter:
- Type the following command to sign out the current account session and press Enter:
shutdown /L
- Type the following command to hibernate the device and press Enter:
shutdown /h
N.B: You should run command prompt as administrator
7. MKDIR (Make directory)
mkdir command to create intermediate directories in a specified path.
syntax mkdir [<drive>:]<path>
making Directory By Example
mkdir directory1
8. DISM(Deployment Image Servicing and Management )
Deployment Image Servicing and Management is a command-line tool that can be used to service and prepare Windows images Learn more about DISM
9. CLS (For Clear Screen )
Used to clear the screen