Appearance
cmd命令详细表格
| 命令 | 描述 | 示例 |
|---|---|---|
| 基础命令 | ||
dir | 列出当前目录中的文件和子目录 | dir /a /s |
cd | 切换目录 | cd C:\Users |
cls | 清屏 | cls |
echo | 显示消息或启用/禁用命令回显 | echo Hello World |
exit | 退出命令提示符 | exit |
help | 显示帮助信息 | help dir |
ver | 显示 Windows 版本 | ver |
title | 设置命令提示符窗口标题 | title My Command Prompt |
chdir | 显示当前目录或更改目录 | chdir |
prompt | 更改命令提示符 | prompt $P$G |
| 文件操作命令 | ||
copy | 复制文件 | copy file1.txt file2.txt |
move | 移动文件或重命名文件/目录 | move file1.txt C:\backup |
del | 删除文件 | del *.tmp |
type | 显示文件内容 | type readme.txt |
ren | 重命名文件或目录 | ren oldname.txt newname.txt |
fc | 比较两个文件的内容 | fc file1.txt file2.txt |
find | 在文件中搜索字符串 | find "error" log.txt |
attrib | 显示或更改文件属性 | attrib +h secret.txt |
type | 显示文本文件内容 | type config.txt |
more | 逐页显示文件内容 | more log.txt |
sort | 对文件内容进行排序 | sort file.txt |
fc | 比较两个文件的差异 | fc file1.txt file2.txt |
| 文件夹操作命令 | ||
md | 创建新目录 | md new_folder |
rd | 删除目录 | rd /s old_folder |
tree | 以树状结构显示目录内容 | tree /f |
xcopy | 复制文件和目录树 | xcopy C:\source D:\destination /s /e |
robocopy | 高级文件复制 | robocopy C:\source D:\destination /mir /z |
| 网络命令 | ||
ipconfig | 显示网络配置 | ipconfig /all |
ping | 测试网络连接 | ping google.com |
tracert | 跟踪路由 | tracert google.com |
netstat | 显示网络连接 | netstat -an |
arp | 显示和修改 ARP 缓存 | arp -a |
nslookup | 域名系统查询 | nslookup google.com |
net | 网络命令集合 | net use |
| 系统命令 | ||
systeminfo | 显示系统信息 | systeminfo |
tasklist | 显示正在运行的进程 | tasklist |
taskkill | 终止正在运行的进程 | taskkill /im notepad.exe |
sc | 服务控制 | sc query |
chkdsk | 检查磁盘错误 | chkdsk C: /f |
diskpart | 磁盘分区管理 | diskpart |
format | 格式化磁盘 | format D: /fs:NTFS /q |
label | 创建、更改或删除卷标 | label C: System |
date | 显示或设置日期 | date |
time | 显示或设置时间 | time |
| 其他常用命令 | ||
path | 显示或设置搜索路径 | path C:\Windows\System32 |
set | 显示或设置环境变量 | set PATH |
assoc | 显示或修改文件关联 | assoc .txt=txtfile |
ftype | 显示或修改文件类型关联 | ftype txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1 |
choice | 显示选择菜单 | choice /c YN /m "Continue?" |
for | 循环命令 | for %i in (*.txt) do echo %i |
if | 条件命令 | if exist file.txt echo File exists |
goto | 跳转到标签 | goto :label |
call | 调用批处理文件 | call script.bat |
start | 启动程序或打开文件 | start notepad.exe |
pause | 暂停批处理执行 | pause |
timeout | 等待指定时间 | timeout /t 10 |
color | 设置命令提示符颜色 | color 0A |
mode | 配置系统设备 | mode con: cols=80 lines=25 |
netsh | 网络配置命令 | netsh interface ip show config |
wmic | Windows 管理工具 | wmic cpu get name |
reg | 注册表操作 | reg query HKLM\Software |
schtasks | 计划任务管理 | schtasks /query |
powercfg | 电源配置 | powercfg /list |
driverquery | 显示已安装的驱动程序 | driverquery |
msinfo32 | 系统信息 | msinfo32 |
dxdiag | DirectX 诊断工具 | dxdiag |