Sie sind auf Seite 1von 5

An A-Z Index of the Windows CMD command line

ADDUSERS ADmodcmd ARP ASSOC ASSOCIAT AT ATTRIB b Add or list users to/from a CSV file Active Directory Bulk Modify Address Resolution Protocol Change file extension associations One step files association Schedule a command to run at a specific time Change file attributes

h i

GETMAC GLOBAL GOTO GPRESULT GPUPDATE HELP iCACLS IF IFMEMBER IPCONFIG

Display the Media Access Control (MAC) address Display membership of global groups
Direct a batch program to jump to a labeled line

Display Resultant Set of Policy information Update Group Policy settings Online Help Change file and folder permissions Conditionally perform a command Is the current user a member of a Workgroup Configure IP Remove a program from memory Edit a disk label Display membership of local groups Write text to the event viewer Manage Performance Monitor Log a user off Log the date and time in a file Send email from the command line Baseline Security Analyzer Display memory usage Create new folders Create a symbolic link (linkd) Configure a system device Display output, one screen at a time Manage a volume mount point Move files from one folder to another Move a user from one domain to another Send a message Microsoft Windows Installer System Information
Terminal Server Connection (Remote Desktop Protocol)

BCDBOOT Create or repair a system partition BCDEDIT Manage Boot Configuration Data BITSADMIN Background Intelligent Transfer Service BOOTCFG Edit Windows boot settings BROWSTAT Get domain, browser and PDC info CACLS Change file permissions CALL Call one batch program from another CERTREQ Request certificate from a certification authority CERTUTIL Utility for certification authority (CA) files and services CD Change Directory - move to a specific Folder CHANGE Change Terminal Server Session properties CHKDSK Check Disk - check and repair disk problems CHKNTFS Check the NTFS file system CHOICE Accept keyboard input to a batch file CIPHER Encrypt or Decrypt files/folders CleanMgr Automated cleanup of Temp files, recycle bin CLEARMEM Clear memory leaks CLIP Copy STDIN to the Windows clipboard CLS Clear the screen CLUSTER Windows Clustering CMD Start a new CMD shell CMDKEY Manage stored usernames/passwords COLOR Change colors of the CMD window COMP Compare the contents of two files or sets of files COMPACT Compress files or folders on an NTFS partition COMPRESS Compress individual files on an NTFS partition CON2PRT Connect or disconnect a Printer CONVERT Convert a FAT drive to NTFS COPY Copy one or more files to another location CSCcmd Client-side caching (Offline Files) CSVDE Import or Export Active Directory data DATE Display or set the date DEFRAG Defragment hard drive DEL Delete one or more files DELPROF Delete user profiles DELTREE Delete a folder and all subfolders DevCon Device Manager Command Line Utility DIR Display a list of files and folders DIRUSE Display disk usage DISKPART Disk Administration DISKSHADOW Volume Shadow Copy Service DNSSTAT DNS Statistics DOSKEY Edit command line, recall commands, and create DriverQuery Display installed device drivers DSACLs Active Directory ACLs DSAdd Add items to active directory (user group computer) DSGet View items in active directory (user group computer) DSQuery Search for items in active directory (user group computer) DSMod Modify items in active directory (user group

k l

KILL LABEL LOCAL LOGEVENT LOGMAN LOGOFF LOGTIME

MAPISEND MBSAcli MEM MD MKLINK MODE MORE MOUNTVOL MOVE MOVEUSER MSG MSIEXEC MSINFO32 MSTSC MV NET NETDOM NETSH NETSVC NBTSTAT NETSTAT NOW NSLOOKUP NTBACKUP NTRIGHTS

Copy in-use files Manage network resources Domain Manager


Configure Network Interfaces, Windows Firewall & Remote access

Command-line Service Controller


Display networking statistics (NetBIOS over TCP/IP)

o p

Display networking statistics (TCP/IP) Display the current Date and Time Name server lookup Backup folders to tape Edit user account rights

OPENFILES Query or display open files PATH PATHPING PAUSE PERMS PERFMON PING POPD PORTQRY POWERCFG PRINT PRINTBRM PRNCNFG PRNMNGR
Display or set a search path for executable files Trace route plus network latency and packet loss
Suspend processing of a batch file and display a message

macros

computer)

DSMove DSRM

Move an Active directory Object Remove items from Active Directory

level

ECHO Display message on screen ENDLOCAL End localisation of environment changes in a batch file ERASE Delete one or more files EVENTCREATE Add a message to the Windows event log EXIT Quit the current script/routine and set an error EXPAND EXTRACT Uncompress files Uncompress CAB files Compare two files Search for a text string in a file Search for strings in files Loop command: against a set of files
Loop command: against the results of another command Loop command: all options Files,Directory, List

FC FIND FINDSTR FOR /F FOR /F FOR FORFILES FORMAT FREEDISK FSUTIL FTP FTYPE

Batch process multiple files Format a disk Check free disk space (in bytes) File and Volume utilities File Transfer Protocol File extension file type associations

Show permissions for a user Performance Monitor Test a network connection Return to a previous directory saved by PUSHD Display the status of ports and services Configure power settings Print a text file Print queue Backup/Recovery Display, configure or rename a printer Add, delete, list printers set the default printer PROMPT Change the command prompt PsExec Execute process remotely PsFile Show files opened remotely PsGetSid Display the SID of a computer or a user PsInfo List information about a system PsKill Kill processes by name or process ID PsList List detailed information about processes PsLoggedOn Who's logged on (locally or via resource sharing) PsLogList Event log records PsPasswd Change account password PsPing Measure network performance PsService View and control services PsShutdown Shutdown or reboot a computer PsSuspend Suspend processes PUSHD Save and then change the current directory QGREP
Search file(s) for lines that match a given

pattern

Query Process Display processes (TS/Remote Desktop) Query Session Display all sessions (TS/Remote Desktop) Query TermServer List all servers (TS/Remote Desktop) Query User Display user sessions (TS/Remote Desktop)

r RASDIAL Manage RAS connections RASPHONE Manage RAS connections RECOVER Recover a damaged file from a defective disk REG Registry: Read, Set, Export, Delete keys and values REGEDIT Import or export registry settings REGSVR32 Register or unregister a DLL REGINI Change Registry Permissions REM Record comments (remarks) in a batch file REN Rename a file or files REPLACE Replace or update one file with another Reset Session Delete a Remote Desktop Session RD Delete folder(s) RMTSHARE Share a folder or a printer ROBOCOPY Robust File and Folder Copy ROUTE Manipulate network routing tables RUN Start | RUN commands RUNAS Execute a program under a different user account RUNDLL32 Run a DLL command (add/remove print connections) SC Service Control SCHTASKS Schedule a command to run at a specific time SCLIST Display Services SET Display, set, or remove session environment variables SETLOCAL Control the visibility of environment variables SETX Set environment variables SFC System File Checker SHARE List or edit a file share or print share ShellRunAs Run a command under a different user account SHIFT Shift the position of batch file parameters SHORTCUT Create a windows shortcut (.LNK file) SHOWGRPS List the Workgroups a user has joined SHOWMBRS List the Users who are members of a Workgroup SHUTDOWN Shutdown the computer SLEEP Wait for x seconds SLMGR Software Licensing Management (Vista/2008) SOON Schedule a command to run in the near future SORT Sort input START Start a program, command or batch file SU Switch User SUBINACL Edit file and folder Permissions, Ownership and
Domain

A categorized list of Windows CMD commands


Active Directory ADmodcmd Active Directory Bulk Modify CSVDE Import or Export Active Directory data DSACLs Active Directory ACLs DSAdd Add items to active directory (user group computer) DSGet View items in active directory (user group computer) DSQuery Search for items in active directory (user group computer) DSMod Modify items in active directory (user group DSMove DSRM Batch Files CALL CHOICE CLIP CLS CMD COLOR DOSKEY Move an Active directory Object Remove items from Active Directory Call one batch program from another Accept keyboard input to a batch file Copy STDIN to the Windows clipboard Clear the screen Start a new CMD shell Change colors of the CMD window
Edit command line, recall commands, and create macros computer)

ECHO Display message on screen ENDLOCAL End localization of environment changes in a batch file EVENTCREATE Add a message to the Windows event log EXIT Quit the current script/routine and set an error level FOR /F Loop command: against a set of files FOR /F Loop command: against the results of another FOR Loop command: all options Files, Directory, List GOTO Direct a batch program to jump to a labelled line IF Conditionally perform a command IFMEMBER Is the current user a member of a Workgroup LOGEVENT Write text to the event viewer LOGTIME Log the date and time in a file MAPISEND Send email from the command line MORE Display output, one screen at a time PAUSE Suspend processing of a batch file and display a message PROMPT Change the command prompt REM Record comments (remarks) in a batch file RUN Start | RUN commands RUNAS Execute a program under a different user account SET Display, set, or remove session environment SETLOCAL Control the visibility of environment SETX Set environment variables SORT Sort input SHIFT Shift the position of batch file parameters SLEEP Wait for x seconds START Start a program, command or batch file TIMEOUT Delay processing of a batch file TITLE Set the window title for a CMD.EXE session WAITFOR Wait for or send a signal WMIC WMI Commands :: Comment / Remark Disk Management BOOTCFG Edit Windows boot settings BCDBOOT Create or repair a system partition BCDEDIT Manage Boot Configuration Data CONVERT Convert a FAT drive to NTFS CHKDSK Check Disk - check and repair disk problems CHKNTFS Check the NTFS file system DEFRAG Defragment hard drive DISKPART Disk Administration DISKSHADOW Volume Shadow Copy Service DriverQuery Display installed device drivers FORMAT Format a disk FREEDISK Check free disk space (in bytes) LABEL Edit a disk label MOUNTVOL Manage a volume mount point NTBACKUP Backup folders to tape SFC System File Checker VOL Display a disk label Files and Folders ASSOC Change file extension associations ASSOCIAT One step file association ATTRIB Change file attributes BITSADMIN Background Intelligent Transfer Service CACLS Change file permissions CD Change Directory - move to a specific Folder CIPHER Encrypt or Decrypt files/folders COMP Compare the contents of two files or sets of files COMPACT Compress files or folders on an NTFS partition COMPRESS Compress individual files on an NTFS partition COPY Copy one or more files to another location
variables variables command

SUBST Associate a path with a drive letter SYSTEMINFO List system configuration t TAKEOWN TASKLIST TASKKILL TIME TIMEOUT TITLE TLIST TOUCH TRACERT TREE TSSHUTDN TYPE TypePerf USRSTAT VER VERIFY VOL WAITFOR WHERE WHOAMI WINDIFF WINMSDP WINRM WINRS WMIC WUAUCLT XCACLS XCOPY :: Take ownership of a file List running applications and services Remove a running process from memory Display or set the system time Delay processing of a batch file Set the window title for a CMD.EXE session Task list with full path Change file timestamps Trace route to a remote host Graphical display of folder structure Remotely shut down or reboot a terminal server Display the contents of a text file Write performance data to a log file List domain usernames and last login Display version information Verify that files have been saved Display a disk label Wait for or send a signal Locate and display files in a directory tree Output the current Username and domain
Compare the contents of two files or sets of files

u v

Windows system report Windows Remote Management Windows Remote Shell WMI Commands Windows Update Change file and folder permissions Copy files and folders Comment / Remark

Commands marked are Internal commands only available within the CMD shell. All other commands (not marked with ) are external commands. External commands may be used under the CMD shell, PowerShell, or directly from START-RUN. Copyright SS64.com 1999-2013 Some rights reserved

CSCcmd Client-side caching (Offline Files) DEL Delete one or more files DELTREE Delete a folder and all subfolders DIR Display a list of files and folders ERASE Delete one or more files EXPAND Uncompress files EXTRACT Uncompress CAB files FC Compare two files FIND Search for a text string in a file FINDSTR Search for strings in files FORFILES Batch process multiple files FSUTIL File and Volume utilities FTP File Transfer Protocol FTYPE File extension file type associations iCACLS Change file and folder permissions MD Create new folders MOVE Move files from one folder to another MKLINK Create a symbolic link (linkd) OPENFILES Query or display open files POPD Return to a previous directory saved by PUSHD PsFile Show files opened remotely PUSHD Save and then change the current directory QGREP Search file(s) for lines that match a given pattern RECOVER Recover a damaged file from a defective disk REN Rename a file or files REPLACE Replace or update one file with another RD Delete folder(s) RMTSHARE Share a folder or a printer ROBOCOPY Robust File and Folder Copy SHARE List or edit a file share or print share SHORTCUT Create a windows shortcut (.LNK file) SUBINACL Edit file and folder Permissions, Ownership and Domain TAKEOWN Take ownership of a file TOUCH Change file timestamps TREE Graphical display of folder structure TYPE Display the contents of a text file WHERE Locate and display files in a directory tree WINDIFF Compare the contents of two files or sets of files XCACLS Change file and folder permissions XCOPY Copy files and folders Group Policy/Windows Installer DevCon Device Manager Command Line Utility GPRESULT Display Resultant Set of Policy information GPUPDATE Update Group Policy settings MSIEXEC Microsoft Windows Installer PsInfo List information about a system PsShutdown Shutdown or reboot a computer REGSVR32 Register or unregister a DLL SHUTDOWN Shutdown the computer SLMGR Software Licensing Management (Vista/2008) WUAUCLT Windows Update Networking ARP Address Resolution Protocol BROWSTAT Get domain, browser and PDC info DNSSTAT DNS Statistics GETMAC Display the Media Access Control (MAC) address IPCONFIG Configure IP NET Manage network resources NETDOM Domain Manager NETSH Configure Network Interfaces, Windows Firewall & Remote
access

NBTSTAT Display networking statistics (NetBIOS over TCP/IP) NETSTAT Display networking statistics (TCP/IP) NSLOOKUP Name server lookup PATHPING Trace route plus network latency and packet loss PsPing Measure network performance PING Test a network connection ROUTE Manipulate network routing tables TRACERT Trace route to a remote host Processes KILL Remove a program from memory PATH Display or set a search path for executable files PsExec Execute process remotely PsKill Kill processes by name or process ID PsList List detailed information about processes PsGetSid Display the SID of a computer or a user PsSuspend Suspend processes SCHTASKS Schedule a command to run at a specific time SOON Schedule a command to run in the near future TASKLIST List running applications and services TASKKILL Remove a running process from memory TLIST Task list with full path Printing CON2PRT Connect or disconnect a Printer MODE Configure a system device

PRINT Print a text file PRINTBRM Print queue Backup/Recovery PRNCNFG Display, configure or rename a printer PRNMNGR Add, delete, list printers set the default printer RUNDLL32 Run a DLL command (add/remove print connections) Registry REG Registry: Read, Set, Export, Delete keys and values REGEDIT Import or export registry settings REGINI Change Registry Permissions Remote Desktop CHANGE Change Terminal Server Session properties Query Process Display processes (TS/Remote Desktop) Query Session Display all sessions (TS/Remote Desktop) Query TermServer List all servers (TS/Remote Desktop) Query User Display user sessions (TS/Remote Desktop) MSTSC Terminal Server Connection (Remote Desktop Protocol) RASDIAL Manage RAS connections RASPHONE Manage RAS connections Reset Session - Delete a Remote Desktop Session TSSHUTDN Remotely shut down or reboot a terminal server WINRM Windows Remote Management WINRS Windows Remote Shell Services CASPOL Code Access Security Policy Tool. NETSVC Command-line Service Controller PORTQRY Display the status of ports and services PsService View and control services SC Service Control SCLIST Display Services System Information NOW Display the current Date and Time DATE Display or set the date HELP Online Help LOGMAN Manage Performance Monitor MBSAcli Baseline Security Analyzer MEM Display memory usage MSINFO32 System Information NTRIGHTS Edit user account rights PERFMON Performance Monitor PsLogList Event log records SYSTEMINFO List system configuration TIME Display or set the system time TypePerf Write performance data to a log file VER Display version information VERIFY Verify that files have been saved WINMSDP Windows system report WHOAMI Output the current UserName and domain User Administration ADDUSERS Add or list users to/from a CSV file CERTREQ Request certificate from a certification authority CleanMgr Automated cleanup of Temp files, recycle bin CON2PRT Connect or disconnect a Printer CMDKEY Manage stored usernames/passwords DELPROF Delete user profiles DIRUSE Display disk usage GLOBAL Display membership of global groups LOCAL Display membership of local groups LOGOFF Log a user off MOVEUSER Move a user from one domain to another MSG Send a message PERMS Show permissions for a user POWERCFG Configure power settings PsLoggedOn Who's logged on (locally or via resource sharing) PsPasswd Change account password SHOWGRPS List the Workgroups a user has joined SHOWMBRS List the Users who are members of a Workgroup SUBST Associate a path with a drive letter USRSTAT List domain usernames and last login Commands marked are Internal commands only available within the CMD shell. All other commands (not marked with ) are external commands. External commands may be used under the CMD shell, PowerShell, or directly from START-RUN.

Windows CMD Shell Command Line Syntax


Parameters Variables Redirection AND/OR Logic Command Line Parameters %1 %~f1 Create/read environment variables. Spooling output to a file, piping input. Conditional Execution (If-Then-Else)

Loops Loops and Subroutines. functions How to package blocks of code. Services List of Windows XP Services Evaluating expressions Using brackets to Group and expand expressions. Delayed Expansion Variables within loops. Escape chars, delimiters and quotes SET /A Environment variable arithmetic. VarSubstring Extract part of a variable (substring) VarSearch Search & replace part of a variable. RANDOM Random Numbers. Wildcards Match multiple files. Batch Files Run a script How to run a script. DateMath Add or subtract days from any date. GetDate.cmd Get todays date (any region, any OS.) GetTime.cmd Get the time now. GetGMT.cmd Time adjusted to Greenwich Mean Time. DeQuote Remove quotes from a string. DelOlder Delete files more than n days old. StampMe.cmd Rename a file with the date/time. tdiff.cmd Time difference in Hours/Minutes. Which.cmd Display full path to any command. xlong.cmd Find filenames that exceed the 256 char pathname
limit.

program bye cd close debug

Use `Binary' for transferring executable files or binary data files e.g. Oracle End the FTP session and exit ftp Change the working directory on the remote host. End the FTP session and return to the cmd prompt. Toggle debugging. When debug is on, FTP will display every command.

delete remote-file Delete file on remote host. dir [remote-directory] [local-file] List a remote directory's files and subdirectories. (or save the listing to local-file) disconnect Disconnect from the remote host, retaining the ftp prompt.

Reference/How to

DragDrop.cmd

Drag and drop onto a batch script.

Autoexec Run commands at startup. Slow Browsing Speed up network browsing. Desktop Heap Memory configuration. Long Filenames NTFS filename issues. Display DPI Monitor size settings. CMD Internal Commands that are Internal to the CMD shell. Keyboard CMD Keyboard shortcuts. Printing Printer connections and print drivers. Recovery The Recovery Console. RUN commands Start | Run commands. ProfileFolders Location of User profile folders(XP/Vista/Windows 7). Registry User interface settings (XP) BuiltIn Groups Built-In Users and Security Groups. Groups Local Domain groups, Global and Universal
groups.

get remote-file [local-file] Copy a remote file to the local PC. glob Toggle the use of wildcard characters in local pathnames. By default, globbing is on. Toggle printing a hash (#) for each 2K data block transferred. By default, hash mark printing is off.

hash

help [command] Display help for ftp command. lcd [directory] Change the working directory on the local PC. By default, the working directory is the directory in which ftp was started. literal argument [ ...] Send arguments, as-is, to the remote FTP host. ls [remote-directory] [local-file] List a remote directory's files and folders. (short format) mdelete remote-files [ ...] Delete files on remote host. mdir remote-files [ ...] local-file Display a list of a remote directory's files and subdirectories. (or save the listing to local-file) Mdir allows you to specify multiple files. mget remote-files [ ...] Copy multiple remote files to the local PC. mkdir directory Create a directory on the remote host. mls remote-files [ ...] local-file List a remote directory's files and folders. (short format) mput local-files [ ...] Copy multiple local files to the remote host. open computer [port] Connects to the specified FTP server. prompt files; Toggle prompting. Ftp prompts during multiple file transfers to allow you to selectively retrieve or store mget and mput transfer all files if prompting is turned off. By default, prompting is on. put local-file [remote-file] Copy a local file to the remote host.

64Bit

Detect 64 bit vs 32 bit Windows

FTP
File Transfer Protocol
Syntax FTP [-options] [-s:filename] [-w:buffer] [host] key -s:filename Run a text file containing FTP commands. host -g -n -i -v -w:buffer -d -a Host name or IP address of the remote host. Disable filename wildcards. No auto-login. No interactive prompts during ftp. Hide remote server responses. Set buffer size to buffer (default=4096) Debug Use any local interface when binding data connection.

Commands to run at the FTP: prompt


append local-file [remote-file] Append a local file to a file on the remote computer. ascii line bell binary Set the file transfer type to ASCII, the default. In ASCII text mode, character-set and end-ofcharacters are converted as necessary. Toggle a bell to ring after each command. By default, the bell is off. Set the file transfer type to binary.

pwd quit

Print Working Directory (current directory on the remote host) End the FTP session with the remote host and exit ftp.

Usingthe WindowsGUI for FTP Windows Explorer (not Internet Explorer) also has a built in FTP client. Type in the address bar: ftp://username@ftpserver.address.com you will be prompted for the password. You can also do ftp://username:password@ftpserver.address.com This is not recommended as anyone can read the password. SecureFTP Standard FTP does not encrypt passwords - they are sent across the network in plain text. A more secure method is to use SecureFTP (SFTP) or SecureCopy (SCP) Freeware clients are available e.g. WinSCP Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it - Linus Torvalds .

quote argument [ ...] Send arguments, as-is, to the remote FTP host. recv remote-file [local-file] Copy a remote file to the local PC. remotehelp [command] Display help for remote commands. rename filename newfilename Rename remote files. rmdir directory Delete a remote directory. send local-file [remote-file] Copy a local file to the remote host. status trace Display the current status of FTP connections and toggles. Toggles packet tracing; trace displays the route of each packet

type [type-name] Set or display the file transfer type: `binary' or `ASCII' (the default) If type-name is not specified, the current type is displayed. ASCII should be used when transferring text files. In ASCII text mode, character-set and end-of-line characters are converted as necessary. Use `Binary' for transferring executable files. user user-name [password] [account] Specifes a user to the remote host. verbose ! command ? [command] Toggle verbose mode. By default, verbose is on. Run command on the local PC. Display help for ftp command.

Examples an example FTP Script to retrieve files in binary and then ascii mode: ::GetFiles.ftp [User_id] [ftp_password] binary get /usr/file1.exe get file2.html mget *.jpeg ascii mget *.txt quit To run the above script: FTP -s:GetFiles.ftp [hostname] This will connect as the user:User_id with password:ftp_password An FTP Script to publish files in binary mode: ::PutFiles.ftp [User_id] [ftp_password] binary mput *.html cd images mput *.gif quit To run the above script: FTP -s:PutFiles.ftp [hostname] This will connect as the user:User_id with password:ftp_password