您应该知道的基本Windows CMD命令

在大多数情况下,命令提示符对Windows操作系统而言有点令人恐惧。界面呈黑色,暗淡且没有太多帮助。与Windows界面的其余部分相比,它似乎是空的。尽管给人留下了深刻的印象,但命令提示符还是Windows武库中功能最强大的工具之一。

命令提示符对从复杂的自动化到网络配置的所有操作都非常有用。它缺乏界面,不足以弥补有效性。如果您不知道从哪里开始使用命令提示符,那还有什么比从这里开始更好的地方!

CMD命令

大多数人会立即寻求最佳和最有用的命令,有助于掩盖不同参数的含义。熟练掌握命令提示符不仅是通过掌握命令词典来进行的,而且还要了解每个参数的含义以及如何将不同的参数组合以达到预期的效果。

以下是一个综合列表典型Windows命令中使用的大多数命令。您可以在此处下载PDF版本。的向下滚动到下面的基本命令列表作为命令的立即可用列表

ASSOC - Displays or modifies file extension associations.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.
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 options.CIPHER - Displays or alters the encryption of directories (files) on NTFS partitions.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 console 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 partitions.CONVERT - Converts FAT volumes to NTFS. You cannot convert the current drive.COPY - Copies one of more files to another location.
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.
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 extensions associations.
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.
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.
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.
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.
TAKEOWN - Allows an administrator to take ownership of a file.TASKLIST - Displays all currently running tasks including services.TASKKILL - Kill running process or applications.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.
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 locations of files that match a search pattern.WMIC - Displays WMI information inside interactive command shell.XCOPY - Copies files and directory trees.

注意:为了具有命令提示符的完全访问权限,您必须以管理员身份运行提示符。管理员权限允许用户访问否则无法访问的命令。

要激活管理员模式,请打开您的开始菜单,键入 cmd ,右键单击CMD程序,然后选择以管理员身份运行。在Windows 10中,还可以右键单击“开始"按钮,然后选择命令提示符(Admin)

基本命令列表

CMD命令编号

无需重新安装操作系统即可修复重要的系统文件。

最好以安全模式运行此命令立即出现的操作系统问题可能会危及彻底修复。

修复文件系统错误,坏扇区并恢复可读信息。运行chkdsk命令有两种方法。

  • chkdsk / F -运行chkdsk并修复文件系统错误。
  • chkdsk / R -修复错误,找到错误的扇区,并从这些错误中恢复信息。比 / F 更全面的扫描。
  • Ping pathping (更全面的ping形式)将回显或显示发送到特定网站或从特定网站发送的数据包。路径与 tracert 一起,将显示通向您所需域的途中每个路由器(或跃点)的IP地址。

    默认情况下,某些电源配置(例如休眠模式)默认情况下处于关闭状态。休眠模式与关闭PC的电源相反,它将保存PC的最后状态(程序,窗口等)并加快启动速度。为了启用或禁用,请使用以下命令:

  • powercfg / hibernate on -打开“休眠"模式,可通过默认的Windows电源选项进行访问。
  • 虽然我们大多数人无法正​​常使用PC驱动程序,但有时驱动程序问题会出现起来这可能与性能延迟一样小,也可能与恒定的BSOD一样大。

    虽然driverquery并不能立即带来优势,但它确实概述了PC的驱动程序信息,以便全面了解PC的驱动程序信息。解决硬件和软件问题。

  • driverquery -显示已安装驱动程序的各种列表。
  • driverquery / FO TABLE,LIST CSV -将驱动程序显示为表格,列表或excel电子表格。
  • 如果在原始参数中添加> [FileName.csv] —例如, driverquery / FO CSV> driverquery.csv -您的命令提示符将获取通过driverquery显示的信息并将其输出到Excel工作表。默认情况下,该文件将定向到您的 Windows32 文件夹。

    有时,网络问题可能是由于IP地址错误或DNS(域名服务器)文件损坏而引起的。要解决此问题,请按顺序输入以下命令:

  • ipconfig / release -释放IP地址。
  • ipconfig / renew —替换您以前的IP地址(完成时间比其他两个要长得多)。
  • ipconfig /flushdns — Erases the previously configured DNS listing, allowing websites that were previously unusable to load again.
  • 最好仅在遇到网络问题时执行此操作。更具体地说,当您连接到互联网但某些网站无法正常工作时。

    命令您的提示!

    命令提示符并不是一些奇怪的野兽使您困惑。这是一项简单的功能,配有实用的工具,可控制您PC的几乎所有方面。我们只是为您准备了命令提示符的内容,因此请继续学习!

    您还想学习什么其他命令?让我们在下面的评论中知道!

    图片来源:Roman Marvel和Brian Goff通过Shutterstock.com

    标签: 命令提示符 计算机维护