0% found this document useful (0 votes)
4 views5 pages

Basic Network Commands

The document provides a comprehensive list of common Command Prompt (CMD) commands, detailing their functions related to system information, IP configuration, and network management. It includes instructions for setting static IP addresses, managing DNS servers, and sending messages between users on a network. Additionally, it outlines steps for viewing saved Wi-Fi passwords and reverting to DHCP settings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Basic Network Commands

The document provides a comprehensive list of common Command Prompt (CMD) commands, detailing their functions related to system information, IP configuration, and network management. It includes instructions for setting static IP addresses, managing DNS servers, and sending messages between users on a network. Additionally, it outlines steps for viewing saved Wi-Fi passwords and reverting to DHCP settings.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

list of common CMD (Command Prompt) commands

System Information Commands

Command Description

systeminfo Displays detailed system configuration.

hostname Displays the name of the computer.

ver Displays the Windows version.

set Displays, sets, or removes environment variables.

View Current IP Configuration

Command Description

ipconfig Shows basic IP configuration (IP, subnet mask, gateway).

ipconfig /all Displays detailed info (MAC, DNS, DHCP status, etc.).

getmac Displays the MAC address of the network adapters.

Release & Renew IP Address (DHCP)

Command Description

ipconfig /release Releases the current DHCP IP address.

ipconfig /renew Renews the IP address from the DHCP server.

Manually Set IP Address Using netsh

netsh interface ip set address name="Ethernet" static 192.168.1.100 255.255.255.0 192.168.1.1

Part Description

"Ethernet" Name of the network interface (use netsh interface show interface to find it).

192.168.1.100 Static IP address.

255.255.255.0 Subnet mask.

192.168.1.1 Default gateway.


Set DNS Server Manually

netsh interface ip set dns name="Ethernet" static 8.8.8.8

To set an alternate DNS, run:

netsh interface ip add dns name="Ethernet" 8.8.4.4 index=2

Reset TCP/IP

netsh int ip reset

Check Interface List

netsh interface show interface

Shows the names of all interfaces you can use in the above commands.

Switch Back to DHCP (Auto IP & DNS)

netsh interface ip set address name="Ethernet" source=dhcp

netsh interface ip set dns name="Ethernet" source=dhcp

Open Command Prompt as Administrator

Press Win + R, type cmd, then press Ctrl + Shift + Enter.

Viewing your Wi-Fi (router) password using CMD is possible only if your PC has previously connected
to that Wi-Fi network. Here's how you can retrieve it:

Steps to View Saved Wi-Fi Password Using CMD

1. Open Command Prompt as Administrator

o Press Win + R, type cmd, then press Ctrl + Shift + Enter.

2. View All Saved Wi-Fi Profiles

netsh wlan show profiles

This lists all the Wi-Fi networks your PC has connected to before.

3. Find the Password for a Specific Network

netsh wlan show profile name="YourWiFiName" key=clear


Replace "YourWiFiName" with the name of the Wi-Fi network you want the password for.

4. Look under:

Security settings

Key Content : your_wifi_password_here

Manual IP Address Setup Using CMD

Step 1: Open Command Prompt as Administrator

• Press Windows + R, type cmd, then press Ctrl + Shift + Enter to run as admin.

Step 2: Check Your Network Interface Name

netsh interface show interface

Note the name of your active interface (e.g., Ethernet, Wi-Fi).

Step 3: Set a Static IP Address

netsh interface ip set address name="Ethernet" static 192.168.1.100 255.255.255.0 192.168.1.1

Breakdown:

Parameter Example Description

name= "Ethernet" Replace with your actual adapter name

192.168.1.100 Desired IP address

255.255.255.0 Subnet mask

192.168.1.1 Default gateway (your router IP)

Step 4: Set DNS Servers

netsh interface ip set dns name="Ethernet" static 8.8.8.8

netsh interface ip add dns name="Ethernet" 8.8.4.4 index=2

Sets Google DNS as primary and secondary (you can change them if needed).

Optional: Revert to DHCP (Auto IP)


netsh interface ip set address name="Ethernet" source=dhcp

netsh interface ip set dns name="Ethernet" source=dhcp

Send Messages Using CMD (msg Command)


Basic Syntax:
cmd
CopyEdit
msg [username or session name] [message]

Example 1: Send a message to yourself


cmd
CopyEdit
msg * Hello! This is a test message.

• * means broadcast to all sessions on the local machine.

Example 2: Send to another user on your PC

First, check active users:

cmd
CopyEdit
query user

Then send a message:

cmd
CopyEdit
msg JohnDoe Hello John, this is a message from CMD.

Example 3: Send a message to another PC on your network


cmd
CopyEdit
msg /server:ComputerName username Hello from another computer!

Note:

• Replace ComputerName and username with the correct ones.


• Both computers must be on the same local network or domain.
• Remote messaging only works on Pro, Enterprise, or Education editions, not on Home.
Requirements for msg to work over network

1. Both PCs must be on the same network/domain.


2. The Messenger service is no longer used—msg replaces it.
3. Enable Remote Desktop Services if messaging between different PCs.
4. Turn off any firewall rules that block SMB or RPC.
5. The receiving user must be logged in.

If You Get “Access Denied” or “Error 5”

Try running CMD as Administrator, or use this workaround:

cmd
CopyEdit
runas /user:ComputerName\username "cmd"

Then run the msg command from that session.

You might also like