Sunday, April 9, 2023

40 important windows command you should know

 


ipconfig

Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings. Used without parameters, ipconfig displays Internet Protocol version 4 (IPv4) and IPv6 addresses, subnet mask, and default gateway for all adapters.

ipconfig /all

Displays the full TCP/IP configuration for all adapters. Adapters can represent physical interfaces, such as installed network adapters, or logical interfaces, such as dial-up connections.


findstr

Searches for patterns of text in files.

ipconfig /release

Sends a DHCPRELEASE message to the DHCP server to release the current DHCP configuration and discard the IP address configuration for either all adapters (if an adapter is not specified) or for a specific adapter if the adapter parameter is included. This parameter disables TCP/IP for adapters configured to obtain an IP address automatically. To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters.

ipconfig /renew

Renews DHCP configuration for all adapters (if an adapter is not specified) or for a specific adapter if the adapter parameter is included. This parameter is available only on computers with adapters that are configured to obtain an IP address automatically. To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters.

ipconfig /displaydns

Displays the contents of the DNS client resolver cache, which includes both entries preloaded from the local Hosts file and any recently obtained resource records for name queries resolved by the computer. The DNS Client service uses this information to resolve frequently queried names quickly, before querying its configured DNS servers.


ipconfig /renew

Renews DHCP configuration for all adapters (if an adapter is not specified) or for a specific adapter if the adapter parameter is included. This parameter is available only on computers with adapters that are configured to obtain an IP address automatically. To specify an adapter name, type the adapter name that appears when you use ipconfig without parameters

clip

Redirects the command output from the command line to the Windows clipboard. You can use this command to copy data directly into any application that can receive text from the Clipboard. You can also paste this text output into other programs.

ipconfig /flushdns

Flushes and resets the contents of the DNS client resolver cache. During DNS troubleshooting, you can use this procedure to discard negative cache entries from the cache, as well as any other entries that have been added dynamically.

nslookup

Displays information that you can use to diagnose Domain Name System (DNS) infrastructure. Before using this tool, you should be familiar with how DNS works. The nslookup command-line tool is available only if you have installed the TCP/IP protocol.

cls

Clears the Command Prompt window.

getmac /v

Specifies that the output display verbose information.

powercfg /energy

Analyzes the system for common energy-efficiency and battery life problems.

powercfg /batteryreport

Generates a report of battery usage.

assoc

Displays or modifies file name extension associations. If used without parameters, assoc displays a list of all the current file name extension associations.

chkdsk /f

Fixes errors on the disk. The disk must be locked. If chkdsk cannot lock the drive, a message appears that asks you if you want to check the drive the next time you restart the computer.

chkdsk /r

Locates bad sectors and recovers readable information. The disk must be locked. /r includes the functionality of /f, with the additional analysis of physical disk errors.

sfc /scannnow

Scans the integrity of all protected system files and repairs files with problems when possible.

DISM /Online /Cleanup-Image /CheckHealth

let DISM tool check the system for corruption and fix any problems it finds automatically and quickly

DISM /Online /Cleanup /ScanHealth

check image problems

DISM /Online /Cleanup-Image /RestoreHealth

let DISM tool check the system for corruption and fix any problems it finds automatically

tasklist

Displays a list of currently running processes on the local computer or on a remote computer. Tasklist replaces the tlist tool.

taskkill

Ends one or more tasks or processes. Processes can be ended by process ID or image name. You can use the tasklist command command to determine the process ID (PID) for the process to be ended.

netsh wlan show wlanreport

This will generate a wireless network report that's saved as an HTML file, which you can open in your favorite web browser. The report shows all the Wi-Fi events from the last three days and groups them by Wi-Fi connection sessions.

netsh interface show interface

will list network interface

netsh interface ip show address | findstr “IP Address”

this command let you find ip address


netsh interface ip show dnsservers


show dnsserver settings

netsh advfirewall set allprofiles state off

Type the following command to disable the firewall for all network profiles (domain, private, and public) on Windows 10 and press Enter


netsh advfirewall set allprofiles state on

Type the following command to enable the firewall for all network profiles (domain, private, and public) and press Enter

ping

Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message Protocol (ICMP) echo Request messages. The receipt of corresponding echo Reply messages are displayed, along with round-trip times. ping is the primary TCP/IP command used to troubleshoot connectivity, reachability, and name resolution. Used without parameters, this command displays Help content.

ping -t

Specifies ping continue sending echo Request messages to the destination until interrupted. To interrupt and display statistics, press CTRL+ENTER. To interrupt and quit this command, press CTRL+C.


tracert

This diagnostic tool determines the path taken to a destination by sending Internet Control Message Protocol (ICMP) echo Request or ICMPv6 messages to the destination with incrementally increasing time to live (TTL) field values. Each router along the path is required to decrement the TTL in an IP packet by at least 1 before forwarding it. Effectively, the TTL is a maximum link counter. When the TTL on a packet reaches 0, the router is expected to return an ICMP time Exceeded message to the source computer.

This command determines the path by sending the first echo Request message with a TTL of 1 and incrementing the TTL by 1 on each subsequent transmission until the target responds or the maximum number of hops is reached. The maximum number of hops is 30 by default and can be specified using the /h parameter.

The path is determined by examining the ICMP time Exceeded messages returned by intermediate routers and the echo Reply message returned by the destination. However, some routers do not return time Exceeded messages for packets with expired TTL values and are invisible to the tracert command. In this case, a row of asterisks (*) is displayed for that hop. The path displayed is the list of near/side router interfaces of the routers in the path between a source host and a destination. The near/side interface is the interface of the router that is closest to the sending host in the path.

tracert -d

Stops attempts to resolve the IP addresses of intermediate routers to their names. This can speed up the return of results.

netstat

Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and UDP over IPv6 protocols). Used without parameters, this command displays active TCP connections.

netstat -af


Displays all active connections and the TCP and UDP ports on which the computer is listening.
with fully qualified domain names <FQDN> for foreign addresses (only available on Windows Vista and newer operating systems).

 
netstat -o

Displays active TCP connections and includes the process id (PID) for each connection. You can find the application based on the PID in the Processes tab in Windows Task Manager. This parameter can be combined with -a, -n, and -p. This parameter is available on Microsoft Windows XP, Windows Server 2003, and Windows 2000 if a hotfix is applied.[6]

netstat -e -t 5

this command gives you sent and received statistics every five seconds

route print


print the route table

route add

Add a route

route delete


Delete a route

shutdown /r /fw /f /t 0

This command allows easy instant reboot to UEFI 








Facebook

21thsoft 

No comments:

Post a Comment