命令行参考

The complete list of possible commands is quite large. Collected here is a selection of those that I believe are likely to be the most applicable to home PC use.

Many of the commands listed below are also discussed in more detail elsewhere on this site as is indicated by the link "details here". Most commands have switches that are not given in the table. For more information, open a command prompt and enter "commandname /?" (without quotes). Detailed information about these commands and a larger list is available at this Microsoft reference. These commands are in Windows XP, Vista, andWindows 7.

Selected list of commands
CommandDescriptionExample
assocDisplays or modifies file name extension associations. Used alone, displays a list of all the current file name associationsdetails here
atSchedules commands and programs to run on a computer at a specified time and date. Requires the Schedule service. Superseded by schtasks 
attribConfigures file attributes read only, hidden, systemdetails here
bootcfgUsed to repair or edit the boot.ini filedetails here
cd or chdirDisplays the name of the current directory or changes the current foldercd folderpath
chkdskChecks hard drives for errors. With switches,does repairs.details here
clsClears the screencls
copyCopies a file from one location to anothercopy somefile somefolder
delDeletes one or more filesdetails here
dirDisplays a list of a folder's files and subfoldersdetails here
diskpartDisk management shell. A suite of various commandsdetails here
driverqueryDisplays a list of all installed device drivers and their properties. Requires administrator privileges. (Not available in Windows XP Home)Example here
echoUsed to display a message or to turn off/on messages in batch scriptsecho message
exitExits batch script or current command controlexit
fcCompares two files and displays the differences between themfc file1 file2
findSearches for a text string in a file or files. Can also be used with output from another command. 
findstrSearches for text string patterns in a file using regular expressions 
forRuns a specified command for each item in a setdetails here
fsutilDisplays and configures certain file system properties. A suite of various commandsdetails here
ftypeDisplays or modifies file types used in file name extension associationsdetails here
getmacReturns the media access control (MAC) address for your network cardgetmac
gotoDirects the Windows command interpreter to a labeled line in a batch programdetails here
ifPerforms conditional processing in batch programsdetails here
ipconfigDisplays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settingsdetails here
md or mkdirCreates a directory (folder) or subdirectory (subfolder)details here
moreDisplays one screen of output at a time. Used with another command that has extensive outputdetails here
moveMoves a file from one folder to anotherdetails here
netA suite of various networking and service commandsdetails here
netshNetwork services shell . Complex suite of commands.details here
netstatDisplays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, statistics for the IP, ICMP, TCP, and UDP protocolsdetails here
pathSets the command path in the PATH environment variable, which is the set of directories used to search for executable filesdetails here
pathpingProvides information about network performance and conditions at intermediate hops between a source and destinationdetails here
pauseUsed in batch scriptspause
pingChecks connectivity to other networked computers, routers, or Internet sitesdetails here
popd, pushdChanges the directory being referenced in a command prompt. Pushd changes the directory and stores the previous directory. Popd changes the current directory to the directory stored by the pushd commandpushd somefolder
popd
powercfgManages the power settings such as hibernation. Has numerous switches 
regAdds, changes, and displays registry entries. A suite of various commandsdetails here
rd or rmdirDeletes a directory (folder)details here
ren or renameChanges the name of a file or a set of filesdetails here
scUsed to obtain information about services and to configure them. A suite of various commandsdetails here
schtasksSchedules commands and programs to run periodically or at a specific time 
setDisplays, sets, or removes environment variablesdetails hereand alsohere
sfcSystem file checker scans and verifies the versions of all protected system filessfc /scannow
shutdownShuts down or restarts a computerdetails here
sortAlphabetizes strings from a text file or the output of a command. 
startStarts an application or opens a new command windowdetails here
substAssociates a folder with a drive letterdetails here
systeminfoDisplays detailed configuration information about a computer and its operating systemsysteminfo | more
taskkillEnds one or more tasks or processesdetails here
tasklistDisplays a list of applications and services with their Process ID (PID) for all tasks runningdetails here
treeGraphically displays the directory structure of a folder or drivetree somefolder
typeDisplays the contents of a text filetype somefile.txt
vssadminFor administering and configuring volume shadow copiesdetails here
xcopyPowerful command with many switches for copying and backing up files and foldersdetails here
原文地址:https://www.cnblogs.com/jjkv3/p/2489809.html