Windows Command Line Tools
Privileges
- Not all users can run all commands - Some are the administrator only
- Standard privileges - Normal user, works fine for many commands
- Administrative / elevated privileges - Be a member of the Administrators group, Choose Run as Adiministrator, cmd Ctrl + Shift + Enter
Command line troubleshooting
- Use "help" if you are not sure > 'help dir' > 'help chkdsk'
- Also use - '[command] /?'
- Close the prompt with 'exit'
: To clear the cmd screen: 'cls'
File management
- dir - List files and directories
- cd or chdir - Change working directory, Use backslash \ to specify volume or folder name
- .. - Two dots/periods, The folder above the current folder
MD / CD / RD
- Make / Change / Remove Directory - mkdir / chdir / rmdir
Drive letters
- Each partitions is assigned a letter - Primary storage drive is usually 'C'
- Reference the drive with the letter and a colon - 'C:'
- Combine with the folder - Folder names are separated with backslashes 'C:\Users\owner'
hostname
- View the name of the device - This is very useful when there are 10 different terminal screen tabs in use
- This is the Windows Device name - in the system settings
- cmd - 'hostname'
format
- Formats a disk for use with Windows - You can lose DATA, BACKUP!
copy /v, /y
- /v - Verifies that new files are written correctly
- /y - Suppresses prompting to confirm you want to overwrite
- cmd - copy source destination
xcopy
- copies files and directory trees (multiple)
- cmd - xcopy /s Documents m:\backups
Robust copy
- robocopy - A better xcopy (included with Windows 10 and 11), Extensive features
shutdown
- Shutdown a computer
- shutdown /s /t nn - Wait nn sec, then shutdown
- shutdown /r /t nn - Shutdown and restart after nn sec
- shutdown /a - Abort the shutdown! (stop the shutdown)
diskpart
- Manage disk configurations - You can lose DATA
winver
- View the About Windows dialog - A quick check
- Useful when troubleshooting - Are you running the latest version?
Managing Group Policy
- Group Policy - Manage computers in a Active Directory Domain, Group Policy is usually updated at login
- gpupdate - Force a Group Policy update : allow the user to perform that update without having to cycle
- gpupdate /target: {computer | user}
- gpupdate /target: user /force
- gpresult - Verify policy settings for a computer or user
- gpresult /r - complie all of the information about the current Active Directory configuration
- gpresult /user sgc/professor /v
The Windows Network Command Line
ipconfig
- Most of your troubleshooting starts with your IP address - ping [your local router/gateway]
- Determine TCP/IP and network adapter information - And some additional IP details
- View additional configuration details - DNS servers, DHCP server, etc.
ping
- Test reachability - Determine round-trip time, Uses Internal Control Message Protocol (ICMP)
- One of your primary troubleshooting tools - Can you ping the host?
netstat
- Network statistics - Many different operating systems
- netstat -a - Show all active connections
- netstat -b - Show binaries (Windows) requires elevation (administrator only)
- netstat -n - Do not resolve names, just IP address
nslookup
- Name Server lookup - lookup information from DNS servers, Canonical names, IP addresses, cache timers, etc
- Lookup names and IP addresses - Many different options
- cmd - nslookup [domain address]
net
- Windows network commands
Common 'net' commands
- View network resources - net view \\<servername>, net view /workgroup:<work group name>
- Map a network share to a drive letter - net use <drive letter>: \\<servername>\<sharename>
- View user account information and reset passwords - net user <username>, net user <username> * /domain
tracert
- Determine the route a packet tasks to a destination - map the entire path
- takes advantage of ICMP Time to Live Exceeded error message
- The time in TTL refers to hops, not seconds or minutes
- TTL = 1 is the first router, TTL = 2 is the second router, etc
- Not all devices will reply with ICMPTime Exceeded messages
- Some firewalls filter ICMP
- ICMP is low-priority for many devices
- TTL is decreased by hitting the router - If TTL is exceeded (TTL = 0), TTL is sent back to sender's computer and then increasing TTL and repeating this way until receiver get the message. Then, receiver send ICMP Reply to sender.
pathping
- Combine ping and traceroute - Included with Windows NT and later
- First phase runs a traceroute - Build a map
- Second phase - Measure round trip time and packet loss at each hop
'CompTIA A+ > 220-1102' 카테고리의 다른 글
1.6 Windows Networking (0) | 2024.02.16 |
---|---|
1.5 Windows Settings (0) | 2024.02.13 |
1.4 The Windows Control Panel (0) | 2024.02.13 |
1.3 The Windows OS (0) | 2024.02.12 |
1.1 Microsoft Windows (0) | 2024.02.09 |