0% found this document useful (0 votes)
36 views8 pages

Windows Command Line System Info Guide

Uploaded by

sagorsheikh545
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)
36 views8 pages

Windows Command Line System Info Guide

Uploaded by

sagorsheikh545
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

Operating system Command

Windows Command:

1. help

 Description: Lists all available commands in the Command Prompt with a brief
description.
 Example: help

2. cls

 Description: Clears the Command Prompt screen.


 Example: cls

3. cd

 Description: Changes the current directory.


 Example: cd C:\Users\YourUsername\Documents

4. dir

 Description: Lists all files and folders in the current directory.


 Example: dir

5. copy

 Description: Copies files from one location to another.


 Example: copy C:\source\[Link] D:\destination

6. move

 Description: Moves files from one location to another.


 Example: move C:\source\[Link] D:\destination

7. del

 Description: Deletes one or more files.


 Example: del C:\source\[Link]

8. mkdir

 Description: Creates a new directory.


 Example: mkdir C:\new_folder

9. rmdir

 Description: Deletes a directory (folder).


 Example: rmdir C:\new_folder

10. ipconfig

 Description: Shows network configuration details, such as IP address and subnet mask.
 Example: ipconfig

11. ping

 Description: Tests network connectivity to a remote host.


 Example: ping [Link]

12. tracert

 Description: Shows the path taken to a destination IP address.


 Example: tracert [Link]

13. netstat

 Description: Displays active network connections and listening ports.


 Example: netstat -an

14. tasklist

 Description: Lists all running processes on the system.


 Example: tasklist

15. taskkill

 Description: Ends a running process by its name or PID.


 Example: taskkill /IM [Link]

16. systeminfo

 Description: Shows detailed system information.


 Example: systeminfo

17. chkdsk

 Description: Checks for disk errors and repairs them.


 Example: chkdsk C: /f

18. sfc /scannow

 Description: Scans and repairs corrupted system files.


 Example: sfc /scannow

19. diskpart

 Description: Manages disks, partitions, and volumes.


 Example: diskpart

20. format

 Description: Formats a disk for use with Windows.


 Example: format D:

21. shutdown

 Description: Shuts down, restarts, or logs off the computer.


 Example: shutdown /r /t 0 (Restarts the computer immediately)

22. powercfg

 Description: Configures power settings and displays energy efficiency details.


 Example: powercfg /hibernate on

23. gpupdate

 Description: Forces a Group Policy update.


 Example: gpupdate /force

24. gpresult

 Description: Displays applied Group Policy settings.


 Example: gpresult /R

25. regedit

 Description: Opens the Windows Registry Editor.


 Example: regedit

26. sc config

 Description: Configures Windows services.


 Example: sc config Spooler start= auto

27. sc start / stop

 Description: Starts or stops a Windows service.


 Example: sc start Spooler (Starts the Print Spooler service)

28. net start / stop

 Description: Starts or stops network services.


 Example: net start Spooler

29. net use

 Description: Maps or disconnects network drives.


 Example: net use Z: \\server\share

30. net user

 Description: Manages user accounts.


 Example: net user username password /add

31. hostname

 Description: Displays the computer’s hostname.


 Example: hostname

32. set

 Description: Displays, sets, or removes environment variables.


 Example: set PATH

33. date

 Description: Displays or sets the current date.


 Example: date

34. time

 Description: Displays or sets the current time.


 Example: time

35. echo

 Description: Displays a line of text.


 Example: echo Hello, world!

36. pause

 Description: Pauses execution in a batch file.


 Example: pause

37. attrib

 Description: Displays or changes file attributes.


 Example: attrib +r [Link]

38. assoc

 Description: Displays or modifies file type associations.


 Example: assoc .txt=txtfile

39. cipher

 Description: Encrypts or decrypts files.


 Example: cipher /e C:\secret_folder

40. cacls

 Description: Changes file permissions.


 Example: cacls [Link] /g username:f

41. fc

 Description: Compares two files and displays differences.


 Example: fc [Link] [Link]

42. find

 Description: Searches for text within files.


 Example: find "keyword" [Link]

43. schtasks

 Description: Manages scheduled tasks.


 Example: schtasks /create /tn Backup /tr "[Link]" /sc daily /st
02:00

44. wmic
 Description: Windows Management Instrumentation Command-line to get system info.
 Example: wmic os get name

45. driverquery

 Description: Lists all installed drivers.


 Example: driverquery

46. shutdown /s /f /t 0

 Description: Instantly shuts down the computer.


 Example: shutdown /s /f /t 0

47. whoami

 Description: Displays the current user and domain.


 Example: whoami

48. title

 Description: Sets the Command Prompt window title.


 Example: title My Custom Command Prompt

49. pathping

 Description: Combines ping and tracert for a detailed path analysis.


 Example: pathping [Link]

50. route

 Description: Displays and modifies the IP routing table.


 Example: route print
WMIC:

WMIC (Windows Management Instrumentation Command-line) commands, which are


powerful tools for querying and managing system information on Windows:

1. Get Operating System Information

 Command: wmic os get caption, version, architecture


 Description: Retrieves the operating system name, version, and architecture.
 Example Output: Microsoft Windows 10 Pro 10.0.19041 x64

2. Get Computer System Information

 Command: wmic computersystem get model, manufacturer, name, systemtype


 Description: Displays details about the computer system model, manufacturer, name,
and system type.
 Example Output: Dell Inc. XPS 13 9370 Desktop

3. List Installed Software

 Command: wmic product get name, version


 Description: Lists all installed software on the system with their versions.
 Note: This command may take a while to run and may not show all software.
 Example Output: Microsoft Office 365 16.0.12325.20288

4. Get CPU Information

 Command: wmic cpu get name, numberofcores, maxclockspeed


 Description: Shows details about the CPU, including its name, number of cores, and max
clock speed.
 Example Output: Intel(R) Core(TM) i7-8565U CPU 1800 MHz

5. Get Hard Drive Information

 Command: wmic diskdrive get model, size, status


 Description: Provides details on the installed hard drives, including model, size (in
bytes), and status.
 Example Output: Samsung SSD 970 EVO 500GB Healthy

6. Get Memory (RAM) Information

 Command: wmic memorychip get capacity, speed, manufacturer


 Description: Displays information on each installed memory module, including capacity
(in bytes), speed, and manufacturer.
 Example Output: 8 GB 2666 MHz Samsung
7. Get Network Adapter Information

 Command: wmic nic get name, macaddress, speed


 Description: Lists network adapters, including their MAC addresses and speeds.
 Example Output: Intel(R) Wi-Fi 6 AX201 2400 Mbps 00-1A-2B-3C-4D-5E

8. Check Battery Status (for laptops)

 Command: wmic path win32_battery get estimatedchargeRemaining,


batterystatus
 Description: Provides information on the battery status, including the remaining charge
percentage.
 Example Output: Estimated Charge Remaining: 85%

9. Get BIOS Information

 Command: wmic bios get manufacturer, smbiosbiosversion, serialnumber


 Description: Displays BIOS information such as the manufacturer, version, and serial
number.
 Example Output: Dell Inc. 1.8.1 F7G8J5B

10. Get List of Running Processes

 Command: wmic process get name, processid


 Description: Lists all currently running processes with their process IDs (PIDs).
 Example Output: [Link] 1234

Common questions

Powered by AI

The 'tracert' command helps to identify the specific routers a packet passes through when traveling to the destination, which is useful for identifying routing issues and network bottlenecks . 'Pathping' combines the functionality of 'ping' and 'tracert' by not only tracing the route but also gathering additional data about network latency and packet loss at each hop, providing a more comprehensive network analysis . Thus, using 'tracert' can give initial insight into the network path, while 'pathping' can provide deeper analysis of latency and loss characteristics along the same path.

The 'wmic' command enhances system administrative tasks by allowing administrators to query and configure system settings directly from the command line, providing a powerful set of tools for managing various system aspects . For instance, it can retrieve detailed information about the operating system, hardware components like CPU and memory, installed software, and network configurations . Additionally, 'wmic' can be used for task automation, reporting, and diagnosing system health, making it an indispensable tool for system administrators in optimizing and maintaining Windows environments efficiently.

The 'tasklist' command is used to list all running processes on a system, providing details like process IDs, which are necessary to target specific processes for termination . Once a user identifies an unwanted or problematic process via 'tasklist', the 'taskkill' command can be employed to terminate that process by specifying its process ID or image name, thus effectively managing system resources and resolving process-related issues . The combination of these commands is powerful in troubleshooting performance issues or terminating unresponsive applications.

Environment variables are crucial for applications and processes to access system paths and settings that influence their operations. They provide a means to store configuration details and system information that can be used by multiple programs and scripts. The 'set' command in Windows is pivotal for managing these variables by allowing users to display, modify, or delete environment variables . For example, modifying the PATH variable is essential when configuring software that requires access to executables stored in specific directories. Thus, the ability to manage these variables effectively ensures that system and application configurations are easily adjusted as needed.

The 'netstat' command plays a significant role in network security by displaying active TCP connections, listening ports, and network statistics, which can help administrators identify potentially unauthorized connections or processes . System administrators use its data to monitor network traffic patterns, track connections to unknown or suspicious IP addresses, and verify the presence of unnecessary open ports that could increase vulnerability to attacks. Regular use of 'netstat' aids in promptly detecting and mitigating network threats, securing servers from potential breaches by ensuring only expected and authorized connections are active.

The 'sfc /scannow' command is appropriate in scenarios where there are symptoms of corrupted or missing system files, such as application crashes, errors, or unexpected system behavior . It checks for and repairs integrity violations in system files, thereby restoring system health without needing full reinstallation. However, its limitations include being unable to repair all types of file damage, especially if the issue lies within user data files or third-party software components . Additionally, it does not address hardware-related issues, such as faulty RAM or hard disk failures.

The 'ping' command helps diagnose network issues by sending packets to a specific host and measuring the time it takes for the packets to return, thus checking the connectivity between two points . However, based on your network configuration or security settings, certain systems may not respond to ping requests, which could lead to false assumptions about connectivity issues . Moreover, 'ping' only provides information about the reachability of a host and not about the path or potential congestion issues that might also affect network performance.

The 'move' command is more efficient in file management compared to using 'copy' followed by 'del' because it moves a file directly from one location to another without creating a second instance of the file . Using 'copy' and 'del' is less efficient as it involves two operations: creating a duplicate file and then deleting the original, which is redundant and time-consuming especially for large files or when disk space is limited . Furthermore, 'move' can conserve system resources and reduce the risk of data synchronization issues that might occur if a file is modified after copying but before deletion.

The 'mkdir' command is used to create new directories, while 'rmdir' deletes existing directories . These commands are complementary in directory management tasks, as 'mkdir' is often used to set up the directory structure needed for organizing files and projects, while 'rmdir' is used to remove directories that are no longer needed to maintain an organized and clutter-free filesystem. For example, a user might use 'mkdir ProjectX' to create a project folder and later 'rmdir ProjectX /S' when the project is completed and archived elsewhere.

The 'schtasks' command is beneficial for task automation as it allows the creation, deletion, and management of scheduled tasks from the command line, providing flexibility in automating repetitive tasks like backups, updates, and system cleanups . Automation using 'schtasks' enhances efficiency by ensuring tasks run at specified times without manual intervention. However, potential risks include unauthorized access where a malicious user could schedule harmful scripts, and misconfigured tasks causing system instability or data loss. Proper permissions and regular audits of scheduled tasks are recommended to mitigate such risks.

You might also like