命令提示符暗淡的介面是您訪問高階Windows工具的門戶。我們向您展示了可以讓您訪問它們的基本CMD命令。...
對大多數人來說,命令提示符是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網站