对大多数人来说,命令提示符是Windows操作系统的一个有点可怕的装饰。界面是黑色的,暗淡的,没有太多的帮助。与Windows界面的其他部分相比,它似乎是空的。尽管命令提示符给人的第一印象不太好,但它是Windows系统中最强大的工具之一。
从复杂的自动化到网络配置,命令提示符都很有用。它在界面上所缺少的不仅仅是在有效性上所弥补的。如果您不知道从何处开始熟练掌握命令提示符,还有什么地方比从这里开始更好呢!
cmd命令
虽然大多数人会立即寻找最佳和最有用的命令,但它有助于掩盖不同参数的含义。熟练使用命令提示符不仅要有一个命令词典,还要了解每个参数的含义以及如何将不同的参数组合起来以达到预期的效果。
下面是典型Windows命令中使用的大多数命令的综合列表。你可以在这里下载PDF版本。向下滚动到下面的基本命令列表,以获得可立即使用的命令列表。
a--b
ASSOC - Displays or modifies file extension associati***. ATTRIB - Displays or changes file attributes. BREAK - Sets or clears extended CTRL+C checking. BCDBOOT - Used to copy critical files to the system partition and to crate a new system BCD store. BCDEDIT - Sets properties in boot database to control boot loading.
c级
CACLS - Shows or changes access control lists (ACLs) of files. CALL - Calls a batch program from another. CD - Shows the name of or changes to a current directory. CHCP - Displays or sets the active code page number. CHDIR - Displays the name of or changes to the current directory. CHKDSK - Checks a disk and displays a status report. CHKNTFS - Displays or modifies the checking of disk at boot time. CHOICE - Batch file command that allows users to select from a set of opti***. CIPHER - Displays or alters the encryption of directories (files) on NTFS partiti***. CLIP - Redirects output off another command to the Windows clipboard. CLS - Clears the screen. CMD - Starts a new instance of the Windows command interpreter. CMDKEY - Creates, lists, and deletes stored user names and passwords or credentials. COLOR - Sets the default c***ole colors. COMP - Compares the contents of two files or sets of files byte-by-byte. COMPACT - Displays or alters the compression of files on NTSF partiti***. CONVERT - Converts FAT volumes to NTFS. You cannot convert the current drive. COPY - Copies one of more files to another location.
d级
DATE - Displays or sets the date. DEFRAG - Disk defragment accessory. DEL - Deletes one or more files. DIR - Displays a list of files and sub-directories in a directory. DISKCOMP - Compares the contents of two floppy disks. DISKCOPY - Copies the contents of one floppy disk to another. DISKPART - Displays or configures Disk Partition properties. DOSKEY - Edits command lines, recalls Windows commands, and creates macros. DRIVERQUERY - Displays current device driver status and properties.
电子
ECHO - Displays messages, or turns commands echoing on or off. ENDLOCAL - Ends localization of environment changes in a batch file. ERASE - Deletes one of more files. EXIT - Quits and closes the command shell. EXPAND - Expands compressed files.
f级
FC - Compares two files or sets of files, and displays the differences between them. FIND - Searches for a text string in a file or files. FINDSTR - Searches for strings in files. FOR - Runs a specified command for each item in a set. FORFILES - Selects files in a folder for batch processing. FORMAT - Formats a disc for use with Windows. FSUTIL - Displays or configures the file system properties. FTYPE - Displays or modifies file types used in file extensi*** associati***.
g——我
GOTO - Directs the Windows command interpreter to a labeled line in a batch program. GPRESULT - Displays Group Policy Information for machine or user. GRAFTABL - Enables Windows to display an extended character set in graphics mode. HELP - Provides help information for Windows commands. ICACLS - Display, modify, backup, or restore ACLs for files and directories. IF - Performs conditional processing in batch programs. IPCONFIG - Displays all current TCP/IP network configuration values.
l—m型
LABEL - Creates, changes, or deletes the volume label of a disk. MD - Creates a directory. MKDIR - Creates a directory. MKLINK - Creates Symbolic Links and Hard Links. MODE - Configures a system device. MORE - Displays output one screen at a time. MOVE - Moves one or more files from one directory to another directory.
o—p型
OPENFILES - Queries, displays, or disconnects open files or files opened by network users. PATH - Displays or sets a search path for executable files. PAUSE - Suspends processing of a batch file. POPD - Restores the previous value of the current directory saved by PUSHD. PRINT - Prints a text file. PROMPT - Changes the Windows command prompt. PUSHD - Saves the current directory then changes it.
右
RD - Removes a directory. RECOVER - Recovers readable information from a bad or defective disk. REM - Designates comments (remarks) in batch files. REN - Renames a file or files. RENAME - Renames a file or files. REPLACE - Replaces files. RMDIR - Removes a directory. ROBOCOPY - Advanced utility to copy files and directory trees.
s码
SET - Displays, sets, or removes environment variables for current session. SETLOCAL - Begins localization of environment changes in a batch file. SETX - Sets environment variables. SC - Displays or configures services (background processes). SCHTASKS - Schedules commands and programs to run on a computer. SHIFT - Shifts the position of replaceable parameters in batch files. SHUTDOWN - Allows proper local or remote shutdown of machine. SORT - Sorts input. START - Starts a separate window to run a specified programs or command. SUBST - Associates a path with a drive letter. SYSTEMINFO - Displays machine specific properties and configuration.
t型
TAKEOWN - Allows an administrator to take ownership of a file. TASKLIST - Displays all currently running tasks including services. TASKKILL - Kill running process or applicati***. TIME - Displays or sets the system time. TIMEOUT - Pauses the command processor for the specified number of seconds. TITLE - Sets the window title for a CMD.EXE session. TREE - Graphically displays the directory structure of a drove or path. TYPE - Displays the contents of a text file.
v—x型
VER - Displays the Windows version. VERIFY - Tells Windows whether or verify that your files are written correctly to a disk. VOL - Displays a disk volume label and serial number. VSSADMIN - Volume Shadow Copy Service administration tool. WHERE - Displays the locati*** of files that match a search pattern. WMIC - Displays WMI information inside interactive command shell. XCOPY - Copies files and directory trees.
注意:要完全访问命令提示符,必须以管理员身份运行提示符。管理员权限允许用户访问无法访问的命令。
要激活管理员模式,请打开“开始”菜单,键入cmd,右键单击cmd程序,然后选择“以管理员身份运行”。在Windows10中,您也可以右键单击“开始”按钮并选择“命令提示符(Admin)”。
基本命令列表
CMD命令有数千个,每个命令都有自己的操作。
[命令]/?
以上命令为用户提供了给定特定命令的更多信息。这是最重要的,仅仅因为它允许用户在不依赖第三方资源的情况下理解命令。
sfc/scannow公司
修复关键的系统文件而不需要重新安装操作系统。
最好在安全模式下运行此命令,因为任何立即出现的操作系统问题都可能危及完整的修复。
奇克德斯克
修复文件系统错误、坏扇区,并恢复可读信息。运行chkdsk命令有两种方法。
- chkdsk/F—运行chkdsk并修复文件系统错误。
- chkdsk/R—修复错误,定位坏扇区,并从这些坏错误中恢复信息。比/F更全面的扫描。
平,路径平,tracert
Ping和pathping(一种更全面的Ping形式)将回送或显示发送到特定网站或从特定网站发送的数据包。Pathping和tracert一起,将显示到所需域的每一个路由器(或跃点)的IP地址。
powercfg公司
默认情况下,某些电源配置(如休眠模式)在默认情况下处于关闭状态。休眠模式,而不是关闭电脑的电源,将保存你的电脑的最后状态(程序,窗口等),并启动更快。要启用或禁用,请使用以下命令:
- powercfg/hibernate on—打开hibernate模式,可通过默认的Windows电源选项访问。
- powercfg/hibernate off—关闭休眠模式。
驱动程序查询。。。>[文件名]
虽然我们大多数人都不知道我们的PC驱动程序的头尾,但有时会出现驱动程序问题。这可能与性能延迟一样小,也可能与稳定的BSODs一样大。
虽然driverquery并没有带来立竿见影的优势,但它确实提供了PC驱动程序信息的概述,以便全面解决硬件和软件问题。
- driverquery——显示已安装驱动程序的分类列表。
- driverquery/FO TABLE、LIST或CSV—以表格、列表或excel电子表格的形式显示驱动程序。
如果添加>[文件名.csv]到原始参数--driverquery/FO CSV>;驱动器查询.csv例如,命令提示符将获取通过driverquery显示的信息并将其输出到Excel工作表。默认情况下,该文件将定向到Windows32文件夹。
ipconfig/release、renew、flushdns
有时,网络问题可能通过错误的IP地址或损坏的DNS(****器)文件发生。要解决此问题,请按顺序输入以下命令:
- ipconfig/release—释放您的IP地址。
- ipconfig/renew—替换您以前的IP地址(并且比其他两个地址花费更长的时间)。
- ipconfig/flushdns——删除先前配置的DNS列表,允许以前不可用的网站再次加载。
最好只在你有网络问题的时候这样做。更具体地说,当你连接到互联网,但某些网站将无法工作。
命令你的提示!
命令提示符并不是为了迷惑你而**的怪兽。这是一个简单的功能,塞满了有用的工具,几乎可以控制你电脑的每一个方面。我们只触及了命令提示符为你准备的表面,所以开始学习吧!
你还想学什么命令?请在下面的评论中告诉我们!
图片来源:Roman Marvel和Brian Goff viaShutterstock.com网站