Windows CMD 命令大全

常用 Windows 命令行命令速查,常用命令以绿色标注。

类别命令描述
文件与目录 assoc 显示或修改文件扩展名关联。
Display or modify file extension associations.
文件与目录 attrib 显示或更改文件属性。
Display or change file attributes.
文件与目录 cd 显示或更改当前目录。
Display or change the current directory.
文件与目录 chdir 与 cd 命令相同。
Same as cd command.
文件与目录 copy 将文件复制到另一个位置。
Copy files to another location.
文件与目录 del 删除文件。
Delete files.
文件与目录 dir 显示目录中的文件列表。
List files in a directory.
文件与目录 erase 删除文件(与 del 相同)。
Delete files (same as del).
文件与目录 fc 比较两个文件并显示差异。
Compare two files and display differences.
文件与目录 find 在文件中搜索文本。
Search for text in files.
文件与目录 findstr 在文件中搜索字符串。
Search for strings in files.
文件与目录 format 格式化磁盘。
Format a disk.
文件与目录 md 创建目录。
Create a directory.
文件与目录 mkdir 创建目录。
Create a directory.
文件与目录 mklink 创建符号链接和硬链接。
Create symbolic and hard links.
文件与目录 move 移动文件。
Move files.
文件与目录 rd 删除目录。
Remove a directory.
文件与目录 ren 重命名文件。
Rename files.
文件与目录 rmdir 删除目录。
Remove a directory.
文件与目录 robocopy 高级文件复制工具。
Advanced file copy utility.
文件与目录 tree 显示目录结构。
Display directory structure.
批处理与脚本 call 调用另一个批处理程序。
Call another batch program.
批处理与脚本 echo 显示消息或开关命令回显。
Display messages or toggle echo.
批处理与脚本 endlocal 结束本地化环境变量更改。
End localization of environment changes.
批处理与脚本 for 对一组文件运行命令。
Run a command for each file.
批处理与脚本 goto 跳转到标记行。
Go to a labeled line.
批处理与脚本 if 条件处理。
Conditional processing.
批处理与脚本 pause 暂停并显示消息。
Pause and display a message.
批处理与脚本 rem 批处理中添加注释。
Remarks in batch files.
批处理与脚本 set 显示/设置/删除环境变量。
Display/set/remove environment variables.
网络与通信 ftp 使用 FTP 传输文件。
Transfer files via FTP.
网络与通信 ipconfig 显示 TCP/IP 配置。
Show TCP/IP configuration.
网络与通信 net 管理网络资源。
Manage network resources.
网络与通信 netsh 网络配置工具。
Network Shell utility.
网络与通信 netstat 显示活动连接。
Active connections.
网络与通信 nslookup 查询 DNS。
Query DNS.
网络与通信 ping 测试连通性。
Test connectivity.
网络与通信 tracert 跟踪路由。
Trace route.
系统与管理 chkdsk 检查磁盘。
Check disk.
系统与管理 cls 清屏。
Clear screen.
系统与管理 color 更改控制台颜色。
Change console colors.
系统与管理 diskpart 磁盘分区管理。
Disk partition manager.
系统与管理 exit 退出 CMD。
Exit CMD.
系统与管理 help 命令帮助。
Command help.
系统与管理 hostname 显示主机名。
Show hostname.
系统与管理 msinfo32 显示系统信息。
System Information.
系统与管理 mstsc 远程桌面连接。
Remote Desktop.
系统与管理 path 显示搜索路径。
Display PATH.
系统与管理 powershell 启动 PowerShell。
Start PowerShell.
系统与管理 reg 管理注册表。
Manage Registry.
系统与管理 shutdown 关机/重启。
Shutdown/Restart.
系统与管理 systeminfo 系统属性与配置。
System info.
系统与管理 tasklist 显示运行任务。
List running tasks.
系统与管理 taskkill 终止进程。
Terminate process.
系统与管理 whoami 当前用户与权限。
Current user & privileges.
系统与管理 winget Windows 包管理器。
Windows Package Manager.