Wednesday, October 19, 2016

Windows cmd commands

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, and Windows 7.

Command
Description
Example
assoc
Displays or modifies file name extension associations. Used alone,displays a list of all the current file name associations
at
Schedules commands and programs to run on a computer at a specified time and date. Requires the Schedule service. Superseded by schtasks

attrib
Configures file attributes read only, hidden, system
bootcfg
Used to repair or edit the boot.ini file
cd or chdir
Displays the name of the current directory or changes the current folder
cd folderpath
chkdsk
Checks hard drives for errors. With switches,does repairs.
cls
Clears the screen
cls
copy
Copies a file from one location to another
copy somefile somefolder
del
Deletes one or more files
dir
Displays a list of a folder's files and subfolders
diskpart
Disk management shell. A suite of various commands
driverquery
Displays a list of all installed device drivers and their properties. Requires administrator privileges. (Not available in Windows XP Home)
echo
Used to display a message or to turn off/on messages in batch scripts
echo message
exit
Exits batch script or current command control
exit
fc
Compares two files and displays the differences between them
fc file1 file2
find
Searches for a text string in a file or files. Can also be used with output from another command.

findstr
Searches for text string patterns in a file using regular expressions

for
Runs a specified command for each item in a set
fsutil
Displays and configures certain file system properties. A suite of various commands
ftype
Displays or modifies file types used in file name extension associations
getmac
Returns the media access control (MAC) address for your network card
getmac
goto
Directs the Windows command interpreter to a labeled line in a batch program
if
Performs conditional processing in batch programs
ipconfig
Displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings
md or mkdir
Creates a directory (folder) or subdirectory (subfolder)
more
Displays one screen of output at a time. Used with another command that has extensive output
move
Moves a file from one folder to another
net
A suite of various networking and service commands
netsh
Network services shell . Complex suite of commands.
netstat
Displays active TCP connections, ports on which the computer is listening, Ethernet statistics, the IP routing table, statistics for the IP, ICMP, TCP, and UDP protocols
path
Sets the command path in the PATH environment variable, which is the set of directories used to search for executable files
pathping
Provides information about network performance and conditions at intermediate hops between a source and destination
pause
Used in batch scripts
pause
ping
Checks connectivity to other networked computers, routers, or Internet sites
popd, pushd
Changes 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 command
pushd somefolder
popd
powercfg
Manages the power settings such as hibernation. Has numerous switches

reg
Adds, changes, and displays registry entries. A suite of various commands
rd or rmdir
Deletes a directory (folder)
ren or rename
Changes the name of a file or a set of files
sc
Used to obtain information about services and to configure them. A suite of various commands
schtasks
Schedules commands and programs to run periodically or at a specific time

set
Displays, sets, or removes environment variables
sfc
System file checker scans and verifies the versions of all protected system files
sfc /scannow
shutdown
Shuts down or restarts a computer
sort
Alphabetizes strings from a text file or the output of a command.

start
Starts an application or opens a new command window
subst
Associates a folder with a drive letter
systeminfo
Displays detailed configuration information about a computer and its operating system
systeminfo | more
taskkill
Ends one or more tasks or processes
tasklist
Displays a list of applications and services with their Process ID (PID) for all tasks running
tree
Graphically displays the directory structure of a folder or drive
tree somefolder
type
Displays the contents of a text file
type somefile.txt
vssadmin
For administering and configuring volume shadow copies
xcopy
Powerful command with many switches for copying and backing up files and folders
details here


No comments: