Window - CMD

List Installed Programs on PC

C:\Users\USER-PC>wmic product get name


If you want to uninstall an app :

C:\Users\USER-PC>wmic product where "name like '%NAMEOFAPP%'" call uninstall /nointeractive

Manually Repairing the Windows Bootloader

X:\Sources>bootrec.exe /fixmbr
The operation completed successfully.

X:\Sources>bootsect.exe /nt60 all /force
Target volumes will be updated with BOOTMGR compatible bootcode.

Bootcode was successfully updated on all targeted volumes.

Microsoft DOS cd command

Move back one directory

C:\Users\USER-PC>cd..


Moves back to the root directory

C:\Users\USER-PC>cd\


Move to specific Directory

C:\Users\USER-PC>cd Directory Name

Microsoft DOS dir command

Filter by (starting with 'char')

C:\Users\USER-PC>dir char*


Pauses after each screenful of information

C:\Users\USER-PC>dir /p


Uses wide list format

C:\Users\USER-PC>dir /w

Microsoft DOS tree command

Produce a tree listing and overview of the current directory

C:\Users\USER-PC>tree


Produce a tree listing that include the names of files located in each of the directories in the tree

C:\Users\USER-PC>tree /f

msg

The msg command in Windows is used to send messages to users, sessions, or server machines. Here’s a breakdown of the command and its options:

msg {<username> | <sessionname> | <sessionID>| @<filename> | *} [/server:<servername>] [/time:<seconds>] [/v] [/w] [<message>]


Parameters

  • <username>: The username of the person you want to send a message to.
  • <sessionname>: The name of the session you want to send a message to.
  • <sessionID>: The ID of the session you want to send a message to.
  • @<filename>: A file containing a list of usernames or session IDs to whom you want to send the message.
  • *: Sends the message to all users on the local machine.


Optional Parameters

  • /server:<servername>: Specifies the server where the message should be sent. If not specified, it sends the message to the local machine.
  • /time:<seconds>: Specifies how long the message should be displayed on the recipient's screen. The default is 60 seconds.
  • /v: Displays information about the message being sent.
  • /w: Waits for the message to be acknowledged before returning to the command prompt.


Message

  • [<message>]: The actual message text you want to send.


Examples

Sends the message "Hello, this is a test message." to the user with the username username.

msg username "Hello, this is a test message."


Sends the message to all users currently logged into the local machine.

msg * "Attention, the system will be rebooted in 10 minutes."


Sends the message "Please save your work." to the session with ID 1.

msg 1 "Please save your work."


Sends the message "Your session will expire in 2 minutes." to the user, which will be displayed for 120 seconds.

msg username /time:120 "Your session will expire in 2 minutes."

Multiple command

C:\Users\USER-PC>CMD1 && CMD2

Open CMD Window in Directory

Manual

  1. Open File Explorer
  2. Go to the location you want.
  3. Click on the Address bar, write cmd and click Enter.


CMD

C:\Users\USER-PC>cd "Your Folder Path"

Pause or Continue Windows Updates

Pause Windows Updates

C:\Users\USER-PC>net stop wuauserv
The Windows Update service is stopping.
The Windows Update service was stopped successfully.

C:\Users\USER-PC>net stop bits
The Background Intelligent Transfer Service service is stopping.
The Background Intelligent Transfer Service service was stopped successfully.

C:\Users\USER-PC>net stop dosvc
The Delivery Optimization service is stopping.
The Delivery Optimization service was stopped successfully.


Continue Windows Updates

C:\Users\USER-PC>net start wuauserv
The Windows Update service is starting.
The Windows Update service was started successfully.

C:\Users\USER-PC>net start bits
The Background Intelligent Transfer Service service is starting.
The Background Intelligent Transfer Service service was started successfully.

C:\Users\USER-PC>net start dosvc
The Delivery Optimization service is starting.
The Delivery Optimization service was started successfully.

Permanently Delete a Folder Using Command Line

rd /s /q folderName


The rd /s /q command is used in the Windows Command Prompt to quickly and silently delete a folder and all its contents. This method bypasses the Recycle Bin and avoids any confirmation prompts, making it significantly faster than deleting through the Windows GUI—especially for large or deeply nested directories. It's ideal for scripting, automation, or when performance matters.

Recover network password from wireless profile stored on PC

C:\Users\USER-PC>netsh wlan show profile name="PROFILE NAME" key=clear

Redirect Command Output to a File

CMD FILE Path :

C:\Users\USER-PC>ipconfig > FILENAME.txt


Update FILE In CMD FILE Path :

C:\Users\USER-PC>ipconfig >> "C:\Users\USER-PC\FILENAME.txt"


In Specific Path :

C:\Users\USER-PC>ipconfig > FILENAME.txt


Update FILE In Specific Path :

C:\Users\USER-PC>ipconfig >> "C:\Users\USER-PC\FILENAME.txt"


You may change ipconfig to other CMD function.