💻 Common Windows Commands
🌐 中文版:繁體中文
Gathering local machine info
- Network configuration info
1
ipconfig/all
- OS and version info
- Chinese version
1
systeminfo | findstr /B /C:"作業系統名稱" /C:"作業系統版本"
- English version
1
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
- Chinese version
- System architecture
1
echo %PROCESSOR_ARCHITECTURE%
- Check installed software versions
1
wmic product get name,version
1
powershell "Get-WmiObject -class Win32_Product |Select-Object -Property name,version"
- Query local services
1
wmic service list brief
- Query the process list
1
tasklist
1
wmic process list brief
- Check startup programs
1
wmic startup get command,caption
- Check scheduled tasks
1
schtasks /query /fo LIST /v
- Check the host’s boot time
1
net statistics workstation
- Check the user list
1
net user
- Get local administrator info
1
net localgroup administrators
- Check currently logged-in users
1
query user || qwinsta
- List sessions between the local computer and connected clients
1
net session //usually needs admin privileges to run
- Query the port list
1
netstat -ano
- Check the routing table and the available ARP cache table
1
2route print
arp -a - Disable the firewall
- Windows Server 2003 and earlier
1
netsh firewall set opmode disable
- After Windows Server 2003
1
netsh advfirewall set allprofiles state off
- Windows Server 2003 and earlier
- Check firewall settings
1
netsh firewall show config
- Modify firewall settings
- Windows Server 2003 and earlier
1
netsh firewall add allowedprogram C:\nc.exe "allow nc" enable
- After Windows Server 2003
1
netsh advfirewall add rule name="pass nc" dir=in action=allow program="C:\nc.exe"
- Allow a specific program to exit
1
netsh advfirewall add rule name="Allow nc" dir=out action=allow program="C:\nc.exe"
- Allow port 3389 through
1
netsh advfirewall add rule name="Remote Desktop" protocol=TCP dir=in localport=3389 action=allow
- Windows Server 2003 and earlier
- Customize the firewall log file’s storage location
1
netsh advfirewall set currentprofile logging filename "C:\windows\temp\fw.log"
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.
Comments


