Windows Server Administration: Windows Commands PDF
Document Details
Uploaded by Deleted User
Tags
Summary
This document provides comprehensive information about Windows commands, focusing on automating tasks. It explains the differences between the Command shell and PowerShell, and provides a reference for common commands. The document's guide to using command-line shells is essential for IT professionals and system administrators.
Full Transcript
Tell us about your PDF experience. Windows Commands Article 04/26/2023 All supported versions of Windows and Windows Server have a set of Win32 console commands built in. This set of documentation describes the Windows Commands you can...
Tell us about your PDF experience. Windows Commands Article 04/26/2023 All supported versions of Windows and Windows Server have a set of Win32 console commands built in. This set of documentation describes the Windows Commands you can use to automate tasks by using scripts or scripting tools. Command-line shells Windows has two command-line shells: the Command shell and PowerShell. Each shell is a software program that provides direct communication between you and the operating system or application, providing an environment to automate IT operations. The Command shell was the first shell built into Windows to automate routine tasks, like user account management or nightly backups, with batch (.bat) files. With Windows Script Host, you could run more sophisticated scripts in the Command shell. For more information, see cscript or wscript. You can perform operations more efficiently by using scripts than you can by using the user interface. Scripts accept all commands that are available at the command line. PowerShell was designed to extend the capabilities of the Command shell to run PowerShell commands called cmdlets. Cmdlets are similar to Windows Commands but provide a more extensible scripting language. You can run both Windows Commands and PowerShell cmdlets in PowerShell, but the Command shell can only run Windows Commands and not PowerShell cmdlets. For the most robust, up-to-date Windows automation, we recommend using PowerShell instead of Windows Commands or Windows Script Host for Windows automation. A reference of exit and error codes for Windows Commands can be found in the Debug system error codes articles that may be helpful to understanding errors produced. Windows Commands also include command redirection operators. To learn more of their use, see Using command redirection operators. 7 Note You can also download and install PowerShell Core, the open source version of PowerShell. Command shell file and directory name automatic completion You can configure the Command shell to automatically complete file and directory names on a computer or user session when a specified control character is pressed. By default this control character is configured to be the tab key for both file and directory names, although they can be different. To change this control character, run regedit.exe and navigate to either of the following registry keys and entries, depending on whether you wish to change the value for the current user only, or for all users of the computer. U Caution Incorrectly editing the registry may severely damage your system. Before making the following changes to the registry, you should back up any valued data on the computer. registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\CompletionChar HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\PathCompletionChar Set these values to that of the control character you wish to use. See virtual key codes for a complete list. To disable a particular completion character in the registry, use the value for space (0x20) as it isn't a valid control character. The type of value for this registry entry is REG_DWORD, and can also be specified by hexadecimal or decimal value. You can also enable or disable file and directory name completion per instance of a Command shell by running cmd.exe with the parameter and switch /F:ON or /F:OFF. If name completion is enabled with the /F:ON parameter and switch, the two control characters used are Ctrl-D for directory name completion and Ctrl-F for file name completion. User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings. Command-line reference A-Z To find information about a specific command, in the following A-Z menu, select the letter that the command starts with, and then select the command name. A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z A active add add alias add volume append arp assign assoc at atmadm attach-vdisk attrib attributes attributes disk attributes volume auditpol auditpol backup auditpol clear auditpol get auditpol list auditpol remove auditpol resourcesacl auditpol restore auditpol set autochk autoconv autofmt automount B bcdboot bcdedit bdehdcfg bdehdcfg driveinfo bdehdcfg newdriveletter bdehdcfg quiet bdehdcfg restart bdehdcfg size bdehdcfg target begin backup begin restore bitsadmin bitsadmin addfile bitsadmin addfileset bitsadmin addfilewithranges bitsadmin cache bitsadmin cache and delete bitsadmin cache and deleteurl bitsadmin cache and getexpirationtime bitsadmin cache and getlimit bitsadmin cache and help bitsadmin cache and info bitsadmin cache and list bitsadmin cache and setexpirationtime bitsadmin cache and setlimit bitsadmin cache and clear bitsadmin cancel bitsadmin complete bitsadmin create bitsadmin examples bitsadmin getaclflags bitsadmin getbytestotal bitsadmin getbytestransferred bitsadmin getclientcertificate bitsadmin getcompletiontime bitsadmin getcreationtime bitsadmin getcustomheaders bitsadmin getdescription bitsadmin getdisplayname bitsadmin geterror bitsadmin geterrorcount bitsadmin getfilestotal bitsadmin getfilestransferred bitsadmin gethelpertokenflags bitsadmin gethelpertokensid bitsadmin gethttpmethod bitsadmin getmaxdownloadtime bitsadmin getminretrydelay bitsadmin getmodificationtime bitsadmin getnoprogresstimeout bitsadmin getnotifycmdline bitsadmin getnotifyflags bitsadmin getnotifyinterface bitsadmin getowner bitsadmin getpeercachingflags bitsadmin getpriority bitsadmin getproxybypasslist bitsadmin getproxylist bitsadmin getproxyusage bitsadmin getreplydata bitsadmin getreplyfilename bitsadmin getreplyprogress bitsadmin getsecurityflags bitsadmin getstate bitsadmin gettemporaryname bitsadmin gettype bitsadmin getvalidationstate bitsadmin help bitsadmin info bitsadmin list bitsadmin listfiles bitsadmin makecustomheaderswriteonly bitsadmin monitor bitsadmin nowrap bitsadmin peercaching bitsadmin peercaching and getconfigurationflags bitsadmin peercaching and help bitsadmin peercaching and setconfigurationflags bitsadmin peers bitsadmin peers and clear bitsadmin peers and discover bitsadmin peers and help bitsadmin peers and list bitsadmin rawreturn bitsadmin removeclientcertificate bitsadmin removecredentials bitsadmin replaceremoteprefix bitsadmin reset bitsadmin resume bitsadmin setaclflag bitsadmin setclientcertificatebyid bitsadmin setclientcertificatebyname bitsadmin setcredentials bitsadmin setcustomheaders bitsadmin setdescription bitsadmin setdisplayname bitsadmin sethelpertoken bitsadmin sethelpertokenflags bitsadmin sethttpmethod bitsadmin setmaxdownloadtime bitsadmin setminretrydelay bitsadmin setnoprogresstimeout bitsadmin setnotifycmdline bitsadmin setnotifyflags bitsadmin setpeercachingflags bitsadmin setpriority bitsadmin setproxysettings bitsadmin setreplyfilename bitsadmin setsecurityflags bitsadmin setvalidationstate bitsadmin suspend bitsadmin takeownership bitsadmin transfer bitsadmin util bitsadmin util and enableanalyticchannel bitsadmin util and getieproxy bitsadmin util and help bitsadmin util and repairservice bitsadmin util and setieproxy bitsadmin util and version bitsadmin wrap bootcfg bootcfg addsw bootcfg copy bootcfg dbg1394 bootcfg debug bootcfg default bootcfg delete bootcfg ems bootcfg query bootcfg raw bootcfg rmsw bootcfg timeout break C cacls call cd certreq certutil change change logon change port change user chcp chdir chglogon chgport chgusr chkdsk chkntfs choice cipher clean cleanmgr clip cls cmd cmdkey cmstp color comp compact compact vdisk convert convert basic convert dynamic convert gpt convert mbr copy create create partition efi create partition extended create partition logical create partition msr create partition primary create volume mirror create volume raid create volume simple create volume stripe cscript D date dcdiag dcgpofix defrag del delete delete disk delete partition delete shadows delete volume detach vdisk detail detail disk detail partition detail vdisk detail volume dfsdiag dfsdiag testdcs dfsdiag testdfsconfig dfsdiag testdfsintegrity dfsdiag testreferral dfsdiag testsites dfsrmig diantz dir diskcomp diskcopy diskpart diskperf diskraid diskshadow dispdiag dnscmd doskey driverquery E echo edit endlocal end restore erase eventcreate Evntcmd exec exit expand expand vdisk expose extend extract F fc filesystems find findstr finger flattemp fondue for forfiles format freedisk fsutil fsutil 8dot3name fsutil behavior fsutil dirty fsutil file fsutil fsinfo fsutil hardlink fsutil objectid fsutil quota fsutil repair fsutil reparsepoint fsutil resource fsutil sparse fsutil tiering fsutil transaction fsutil usn fsutil volume fsutil wim ftp ftp append ftp ascii ftp bell ftp binary ftp bye ftp cd ftp close ftp debug ftp delete ftp dir ftp disconnect ftp get ftp glob ftp hash ftp lcd ftp literal ftp ls ftp mget ftp mkdir ftp mls ftp mput ftp open ftp prompt ftp put ftp pwd ftp quit ftp quote ftp recv ftp remotehelp ftp rename ftp rmdir ftp send ftp status ftp trace ftp type ftp user ftp verbose ftp mdelete ftp mdir ftype fveupdate G getmac gettype goto gpfixup gpresult gpt gpupdate graftabl H help helpctr hostname I icacls if import (shadowdisk) import (diskpart) inactive ipconfig ipxroute irftp J jetpack K klist ksetup ksetup addenctypeattr ksetup addhosttorealmmap ksetup addkdc ksetup addkpasswd ksetup addrealmflags ksetup changepassword ksetup delenctypeattr ksetup delhosttorealmmap ksetup delkdc ksetup delkpasswd ksetup delrealmflags ksetup domain ksetup dumpstate ksetup getenctypeattr ksetup listrealmflags ksetup mapuser ksetup removerealm ksetup server ksetup setcomputerpassword ksetup setenctypeattr ksetup setrealm ksetup setrealmflags ktmutil ktpass L label list list providers list shadows list writers load metadata lodctr logman logman create logman create alert logman create api logman create cfg logman create counter logman create trace logman delete logman import and logman export logman query logman start and logman stop logman update logman update alert logman update api logman update cfg logman update counter logman update trace logoff lpq lpr M macfile makecab manage bde manage bde status manage bde on manage bde off manage bde pause manage bde resume manage bde lock manage bde unlock manage bde autounlock manage bde protectors manage bde tpm manage bde setidentifier manage bde forcerecovery manage bde changepassword manage bde changepin manage bde changekey manage bde keypackage manage bde upgrade manage bde wipefreespace mapadmin md merge vdisk mkdir mklink mmc mode more mount mountvol move mqbkup mqsvc mqtgsvc msdt msg msiexec msinfo32 mstsc N nbtstat netcfg netdom net print netsh netstat nfsadmin nfsshare nfsstat nlbmgr nltest nslookup nslookup exit Command nslookup finger Command nslookup help nslookup ls nslookup lserver nslookup root nslookup server nslookup set nslookup set all nslookup set class nslookup set d2 nslookup set debug nslookup set domain nslookup set port nslookup set querytype nslookup set recurse nslookup set retry nslookup set root nslookup set search nslookup set srchlist nslookup set timeout nslookup set type nslookup set vc nslookup view ntbackup ntcmdprompt ntfrsutl O offline offline disk offline volume online online disk online volume openfiles P pagefileconfig path pathping pause pbadmin pentnt perfmon ping pktmon pnpunattend pnputil popd powershell powershell ise print prncnfg prndrvr prnjobs prnmngr prnport prnqctl prompt pubprn pushd pushprinterconnections pwlauncher pwsh Q qappsrv qprocess query query process query session query termserver query user quser qwinsta R rd rdpsign recover recover disk group refsutil reg reg add reg compare reg copy reg delete reg export reg import reg load reg query reg restore reg save reg unload regini regsvr32 relog rem remove ren rename repadmin repair repair bde replace rescan reset reset session retain revert rexec risetup rmdir robocopy route ws2008 rpcinfo rpcping rsh rundll32 rundll32 printui rwinsta S san sc config sc create sc delete sc query schtasks scwcmd scwcmd analyze scwcmd configure scwcmd register scwcmd rollback scwcmd transform scwcmd view secedit secedit analyze secedit configure secedit export secedit generaterollback secedit import secedit validate select select disk select partition select vdisk select volume serverceipoptin servermanagercmd serverweroptin set environmental variables set shadow copy set context set id setlocal set metadata set option set verbose setx sfc shadow shift showmount shrink shutdown simulate restore sort start subcommand set device subcommand set drivergroup subcommand set drivergroupfilter subcommand set driverpackage subcommand set image subcommand set imagegroup subcommand set server subcommand set transportserver subcommand set multicasttransmission subcommand start namespace subcommand start server subcommand start transportserver subcommand stop server subcommand stop transportserver subst sxstrace sysocmgr systeminfo T takeown tapicfg taskkill tasklist tcmsetup telnet telnet close telnet display telnet open telnet quit telnet send telnet set telnet status telnet unset tftp time timeout title tlntadmn tpmtool tpmvscmgr tracerpt tracert tree tscon tsdiscon tsecimp tskill tsprof type typeperf tzutil U unexpose uniqueid unlodctr V ver verifier verify vol vssadmin vssadmin delete shadows vssadmin list shadows vssadmin list writers vssadmin resize shadowstorage W waitfor wbadmin wbadmin delete catalog wbadmin delete systemstatebackup wbadmin disable backup wbadmin enable backup wbadmin get disks wbadmin get items wbadmin get status wbadmin get versions wbadmin restore catalog wbadmin start backup wbadmin start recovery wbadmin start sysrecovery wbadmin start systemstatebackup wbadmin start systemstaterecovery wbadmin stop job wdsutil wecutil wevtutil where whoami winnt winnt32 winrs winsat mem winsat mfmedia wmic writer wscript X xcopy Command-line syntax key Article 09/08/2023 The following table describes the notation used to indicate command-line syntax. Notation Description Text without brackets or braces Items you must type as shown. Placeholder for which you must supply a value. [Text inside square brackets] Optional items. {Text inside braces} Set of required items. You must choose one. Vertical bar ( | ) Separator for mutually exclusive items. You must choose one. Ellipsis ( … ) Items that can be repeated and used multiple times. Commands by Server role Article 07/29/2021 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 A server role describes the primary function of the server. Administrators can choose to dedicate an entire server to one role, or install multiple server roles and sub-roles on a single computer. Each role might include additional command-line tools, installed as part of the role. The following topics provide a list of commands associated with each server role. Print Command Reference Services for Network File System Command Reference Remote Desktop Services (Terminal Services) Command Reference Windows Server Backup Command Reference Print command-line tool reference Article 07/29/2021 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Information and links to each of the associated print command-line tools: Command Description lpq Displays the status of a print queue on a computer running Line printer Daemon (LPD). lpr Sends a file to a computer or printer sharing device running the Line printer Daemon (LPD) service in preparation for printing. Net print Displays information about a specified printer queue, displays information about a specified print job, or controls a specified print job. print Sends a text file to a printer. prncnfg Configures or displays configuration information about a printer. prndrvr Adds, deletes, and lists printer drivers. prnjobs Pauses, resumes, cancels, and lists print jobs. prnmngr Adds, deletes, and lists printers or printer connections, in addition to setting and displaying the default printer. prnport Creates, deletes, and lists standard TCP/IP printer ports, in addition to displaying and changing port configuration. prnqctl Prints a test page, pauses or resumes a printer, and clears a printer queue. pubprn Publishes a printer to the active directory directory service. rundll32 Enables you to automate the installation and configuration of printers printui.dll,printUIEntry using scripts or the command prompt. Services for Network File System command-line tools Article 02/03/2023 Services for Network File System (NFS) provides a file sharing solution that lets you transfer files between computers running Windows Server and UNIX operating systems using the NFS protocol. Information and links to each of the associated NFS command-line tools: Command Description mapadmin Manage User Name Mapping for Microsoft Services for Network File System. mount Mount Network File System (NFS) network shares. nfsadmin Manage Server for NFS and Client for NFS. nfsshare Control Network File System (NFS) shares. nfsstat Display or reset counts of calls made to Server for NFS. rpcinfo List programs on remote computers. showmount Display mounted directories. Related links Command-Line Syntax Key Remote Desktop Services (Terminal Services) command-line tools reference Article 02/03/2023 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Learn about the available Remote Desktop Services (Terminal Services) command-line tools, with descriptions and links for more detailed information. 7 Note To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server. Command Description change Changes the Remote Desktop Session Host server settings for sign in, COM port mappings, and install mode. change Enables or disables logons from client sessions on an Remote Desktop Session Host logon server, or displays current logon status. change Lists or changes the COM port mappings to be compatible with MS-DOS port applications. change Changes the install mode for the Remote Desktop Session Host server. user chglogon Enables or disables logons from client sessions on an Remote Desktop Session Host server, or displays current logon status. chgport Lists or changes the COM port mappings to be compatible with MS-DOS applications. chgusr Changes the install mode for the Remote Desktop Session Host server. flattemp Enables or disables flat temporary folders. logoff Signs out a user from a session on an Remote Desktop Session Host server and deletes the session from the server. msg Sends a message to a user on an Remote Desktop Session Host server. Command Description mstsc Creates connections to Remote Desktop Session Host servers or other remote computers. qappsrv Displays a list of all Remote Desktop Session Host servers on the network. qprocess Displays information about processes that are running on an Remote Desktop Session Host server. query Displays information about processes, sessions, and Remote Desktop Session Host servers. query Displays information about processes that are running on an Remote Desktop process Session Host server. query Displays information about sessions on an Remote Desktop Session Host server. session query Displays a list of all Remote Desktop Session Host servers on the network. termserver query user Displays information about user sessions on an Remote Desktop Session Host server. quser Displays information about user sessions on an Remote Desktop Session Host server. qwinsta Displays information about sessions on an Remote Desktop Session Host server. rdpsign Enables you to digitally sign a Remote Desktop Protocol (.rdp) file. reset Enables you to reset (delete) a session on an Remote Desktop Session Host server. session rwinsta Enables you to reset (delete) a session on an Remote Desktop Session Host server. shadow Enables you to remotely control an active session of another user on an Remote Desktop Session Host server. tscon Connects to another session on an Remote Desktop Session Host server. tsdiscon Disconnects a session from an Remote Desktop Session Host server. tskill Ends a process running in a session on an Remote Desktop Session Host server. tsprof Copies the Remote Desktop Services user configuration information from one user to another. Related links Command-Line Syntax Key Windows Server Backup Command Reference Article 03/03/2021 The following subcommands for wbadmin provide backup and recovery functionality from a command prompt. To configure a backup schedule, you must be a member of the Administrators group. To perform all other tasks with this command, you must be a member of the Backup Operators or the Administrators group, or you must have been delegated the appropriate permissions. You must run wbadmin from an elevated command prompt. (To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.) Subcommand Description Wbadmin enable Configures and enables a daily backup schedule. backup Wbadmin disable Disables your daily backups. backup Wbadmin start Runs a one-time backup. If used with no parameters, uses the settings backup from the daily backup schedule. Wbadmin stop job Stops the currently running backup or recovery operation. Wbadmin get Lists details of backups recoverable from the local computer or, if another versions location is specified, from another computer. Wbadmin get items Lists the items included in a specific backup. Wbadmin start Runs a recovery of the volumes, applications, files, or folders specified. recovery Wbadmin get status Shows the status of the currently running backup or recovery operation. Wbadmin get disks Lists disks that are currently online. Wbadmin start Runs a system state recovery. systemstaterecovery Wbadmin start Runs a system state backup. systemstatebackup Subcommand Description Wbadmin delete Deletes one or more system state backups. systemstatebackup Wbadmin start Runs a recovery of the full system (at least all the volumes that contain the sysrecovery operating system's state). This subcommand is only available if you are using the Windows Recovery Environment. Wbadmin restore Recovers a backup catalog from a specified storage location in the case catalog where the backup catalog on the local computer has been corrupted. Wbadmin delete Deletes the backup catalog on the local computer. Use this command only catalog if the backup catalog on this computer is corrupted and you have no backups stored at another location that you can use to restore the catalog. Adprep Article 04/23/2024 Applies to: Windows Server (All supported versions) The adprep command extends the Active Directory schema and updates permissions as necessary to prepare a forest and domain for a domain controller that runs Windows Server. Adprep.exe is a command-line tool available in Windows Server. You must run adprep from an elevated command prompt. To open an elevated command prompt, select Start, right-select Command Prompt, and then select Run as administrator. Adprep is available in a 32-bit version and a 64-bit version. The 64-bit version runs by default. If you need to run Adprep on a 32-bit computer, run the 32-bit version (Adprep32.exe). For more information about running Adprep.exe and how to resolve errors that can occur when you run it, see Running Adprep.exe. For examples of how this command can be used, see Examples. For more information about running adprep /forestprep , see Prepare a Windows 2000 or Windows Server 2003 Forest Schema for a Domain Controller that Runs Windows Server 2008 or Windows Server 2008 R2. For more information about running adprep /domainprep /gpprep , see Prepare a Windows 2000 or Windows Server 2003 Domain for a Domain Controller That Runs Windows Server 2008 or Windows Server 2008 R2. For more information about running adprep /rodcprep , see Prepare a Forest for a Read- Only Domain Controller. Syntax adprep {/forestprep | /domainprep | /domainprep /gpprep | /rodcprep | /wssg | /silent } Parameters ノ Expand table Parameter Description /forestprep Prepares a forest for the introduction of a domain controller that runs Windows Server. You run this command only once in the forest. You must run this command on the domain controller that holds the schema operations master role (also known as flexible single master operations or FSMO) for the forest. You must be a member of all the following groups to run this command: The Enterprise Admins group The Schema Admins group The Domain Admins group of the domain that hosts the schema master /domainprep Prepares a domain for the introduction of a domain controller that runs Windows Server. You run this command after the forestprep command finishes and after the changes replicate to all the domain controllers in the forest. Run this command in each domain where you plan to add a domain controller that runs Windows Server. You must run this command on the domain controller that holds the infrastructure operations master role for the domain. You must be a member of the Domain Admins group to run this command. /domainprep Performs similar updates to domainprep. However, this command also provides updates that are necessary to enable the Resultant Set of Policy (RSOP) Planning /gpprep Mode functionality. In Active Directory environments that run Microsoft Windows, this command performs updates during off-peak hours. Replicating updates to file system permissions and Active Directory permissions on existing Group Policy objects (GPOs) during off-peak hours minimizes replication traffic. Run this command after the forestprep command finishes and after the changes replicate to all domain controllers in the forest. You must run this command on the infrastructure master for the domain. For more information about running this command in Windows Active Directory environments, see Prepare Your Infrastructure for Upgrade. /rodcprep This parameter updates permissions on the application directory partitions to enable replication of the partitions to read-only domain controllers (RODCs). This operation runs remotely; it contacts the infrastructure master in each domain to update the permissions. You need to run this command only once in the forest. However, you can rerun this command anytime if it fails to complete successfully because an infrastructure master isn't available. You can run this command on any computer in the forest. You must be a member of the Enterprise Admins group to run this command. /wssg Returns an expanded set of exit codes, instead of just 0 (Success) and 1 (Failure). /silent Specifies that no standard output is returned from an operation. This parameter can be used only if /wssg is also used. Parameter Description quit Returns to the prior menu. Help Displays Help for this command. ? Displays Help for this command. Remarks To prepare an existing Windows or Windows Server Active Directory environment for a Windows Server domain controller, run the version of adprep included in the Windows Server installation media. You can also perform verification steps before and after you run the adprep command to help ensure that the operations complete successfully. For more information, see Steps for Extending the Schema. Exit Codes The following table lists exit codes that Adprep can return after an operation completes. ノ Expand table Return Code Description 1 Failure 2 Schema conflict error 3 FSMO role error 4 Connection error 5 Schema upgrade error 6 Unable to modify error 7 Server busy error 8 Permission error 9 Unable to initialize log file error 10 Not a domain controller 11 In nonnative mode Return Code Description 12 Need to run forest update first 13 Forest update already done 14 Domain update already done 15 GPO update already done 16 Forest update wait replication Examples The following example prepares a forest for a domain controller that runs Windows Server: cli adprep /forestprep The following example prepares a domain for a domain controller that runs Windows Server: cli adprep /domainprep The following example prepares a domain for an RODC: cli adprep /rodcprep See also Command-Line Syntax Key append Article 02/03/2023 Allows programs to open data files in specified directories as if they were in the current directory. If used without parameters, append displays the appended directory list. 7 Note This command not supported in Windows 10. Syntax append [[:][;...]] [/x[:on|:off]] [/path:[:on|:off] [/e] append ; Parameters Parameter Description [\ Specifies a drive and directory to append. :] /x:on Applies appended directories to file searches and launching applications. /x:off Applies appended directories only to requests to open files. The /x:off option is the default setting. /path:on Applies appended directories to file requests that already specify a path. /path:on is the default setting. /path:off Turns off the effect of /path:on. /e Stores a copy of the appended directory list in an environment variable named APPEND. /e may be used only the first time you use append after starting your system. ; Clears the appended directory list. /? Displays help at the command prompt. Examples To clear the appended directory list, type: append ; To store a copy of the appended directory to an environment variable named append, type: append /e Related links Command-Line Syntax Key arp Article 02/03/2023 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Displays and modifies entries in the Address Resolution Protocol (ARP) cache. The ARP cache contains one or more tables that are used to store IP addresses and their resolved Ethernet or Token Ring physical addresses. There is a separate table for each Ethernet or Token Ring network adapter installed on your computer. Used without parameters, arp displays help information. Syntax arp [/a [] [/n ]] [/g [] [-n ]] [/d []] [/s []] Parameters Parameter Description [/a Displays current arp cache tables for all interfaces. The /n parameter is case- [] sensitive. To display the arp cache entry for a specific IP address, use arp /a with [/n the inetaddr parameter, where inetaddr is an IP address. If inetaddr is not ] specified, the first applicable interface is used. To display the arp cache table for a specific interface, use the /n ifaceaddr parameter in conjunction with the /a parameter where inetaddr is the IP address assigned to the interface. [/g Identical to /a. [] [/n ] [/d Deletes an entry with a specific IP address, where inetaddr is the IP address. To delete an entry in a table for a specific interface, use the ifaceaddr parameter [] where ifaceaddr is the IP address assigned to the interface. To delete all entries, use the asterisk (*) wildcard character in place of inetaddr. Parameter Description [/s Adds a static entry to the arp cache that resolves the IP address inetaddr to the physical address etheraddr. To add a static arp cache entry to the table for a specific interface, use the ifaceaddr parameter where ifaceaddr is an IP address [] assigned to the interface. /? Displays help at the command prompt. Remarks The IP addresses for inetaddr and ifaceaddr are expressed in dotted decimal notation. The physical address for etheraddr consists of six bytes expressed in hexadecimal notation and separated by hyphens (for example, 00-AA-00-4F-2A-9C). Entries added with the /s parameter are static and do not time out of the arp cache. The entries are removed if the TCP/IP protocol is stopped and started. To create permanent static arp cache entries, place the appropriate arp commands in a batch file and use Scheduled Tasks to run the batch file at startup. Examples To display the arp cache tables for all interfaces, type: arp /a To display the arp cache table for the interface that is assigned the IP address 10.0.0.99, type: arp /a /n 10.0.0.99 To add a static arp cache entry that resolves the IP address 10.0.0.80 to the physical address 00-AA-00-4F-2A-9C, type: arp /s 10.0.0.80 00-AA-00-4F-2A-9C Related links Command-Line Syntax Key assoc Article 02/03/2023 Displays or modifies file name extension associations. If used without parameters, assoc displays a list of all the current file name extension associations. 7 Note This command is only supported within cmd.exe and is not available from PowerShell. Though you can use cmd /c assoc as a workaround. Syntax assoc [[=[]]] Parameters Parameter Description Specifies the file name extension. Specifies the file type to associate with the specified file name extension. /? Displays help at the command prompt. Remarks To make changes in associations, you need administrator privileges. To remove the file type association for a file name extension, add a white space after the equal sign by pressing the SPACEBAR. To associate files without extension to a file type, use just a dot (see the examples). To view current file types that have open command strings defined, use the ftype command. To redirect the output of assoc to a text file, use the > redirection operator. Examples To view the current file type association for the file name extension.txt, type: assoc.txt To remove the file type association for the file name extension.bak, type: assoc.bak= 7 Note Make sure you add a space after the equal sign. To view the output of assoc one screen at a time, type: assoc | more To send the output of assoc to the file assoc.txt, type: assoc>assoc.txt Associatie.log to text files: assoc.log=txtfile Associatie files with no extension to text files: assoc.=txtfile Related links Command-Line Syntax Key ftype command at Article 02/03/2023 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Schedules commands and programs to run on a computer at a specified time and date. You can use at only when the Schedule service is running. Used without parameters, at lists scheduled commands. You must be a member of the local Administrators group to run this command. Syntax at [\computername] [[id] [/delete] | /delete [/yes]] at [\computername] [/interactive] [/every:date[,...] | /next:date[,...]] Parameters Parameter Description \ Specifies a remote computer. If you omit this parameter, at schedules the commands and programs on the local computer. Specifies the identification number assigned to a scheduled command. /delete Cancels a scheduled command. If you omit ID, all of the scheduled commands on the computer are canceled. /yes Answers yes to all queries from the system when you delete scheduled events. Specifies the time when you want to run the command. time is expressed as Hours:Minutes in 24-hour notation (that is, 00:00 (midnight) through 23:59). interactive Allows command to interact with the desktop of the user who is logged on at the time Command runs. every: Runs command on every specified day or days of the week or month (for example, every Thursday, or the third day of every month). Parameter Description Specifies the date when you want to run the command. You can specify one or more days of the week (that is, type M,T,W,Th,F,S,Su) or one or more days of the month (that is, type 1 through 31). Separate multiple date entries with commas. If you omit date, at uses the current day of the month. next: Runs command on the next occurrence of the day (for example, next Thursday). Specifies the Windows command, program (that is,.exe or.com file), or batch program (that is,.bat or.cmd file) that you want to run. When the command requires a path as an argument, use the absolute path (that is, the entire path beginning with the drive letter). If the command is on a remote computer, specify Universal Naming Convention (UNC) notation for the server and share name, rather than a remote drive letter. /? Displays help at the command prompt. Remarks This command doesn't automatically load cmd.exe before running commands. If you're not running an executable (.exe) file, you must explicitly load cmd.exe at the beginning of the command as follows: cmd /c dir > c:\test.out If using this command without command-line options, scheduled tasks appear in a table formatted similar to the following: Status ID Day time Command Line OK 1 Each F 4:30 PM net send group leads status due OK 2 Each M 12:00 AM chkstor > check.file OK 3 Each F 11:59 PM backup2.bat If including an identification number (ID) with this command, only information for a single entry appears in a format similar to the following: Task ID: 1 Status: OK Schedule: Each F Time of Day: 4:30 PM Command: net send group leads status due After you schedule a command, especially a command that has command-line options, check that the command syntax is correct by typing at without any command-line options. If the information in the Command Line column is wrong, delete the command and retype it. If it's still incorrect, retype the command using fewer command-line options. Commands scheduled with at run as background processes. Output is not displayed on the computer screen. To redirect output to a file, use the redirection symbol >. If you redirect output to a file, you need to use the escape symbol ^ before the redirection symbol, whether you are using at at the command line or in a batch file. For example, to redirect output to output.txt, type: at 14:45 c:\test.bat ^>c:\output.txt The current directory for the executing command is the systemroot folder. If you change the system time after you schedule a command to run, synchronize the at scheduler with the revised system time by typing at without command-line options. Scheduled commands are stored in the registry. As a result, you don't lose scheduled tasks if you restart the Schedule service. Do not use a redirected drive for scheduled jobs that access the network. The Schedule service might not be able to access the redirected drive, or the redirected drive might not be present if a different user is logged on at the time the scheduled task runs. Instead, use UNC paths for scheduled jobs. For example: at 1:00pm my_backup \\server\share Do not use the following syntax, where x: is a connection made by the user: at 1:00pm my_backup x: If you schedule an at command that uses a drive letter to connect to a shared directory, include an at command to disconnect the drive when you are finished using the drive. If the drive is not disconnected, the assigned drive letter won't be available at the command prompt. By default, tasks scheduled using this command will stop after 72 hours. You can modify the registry to change this default value. To modify the registry U Caution Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer. 1. Start the registry editor (regedit.exe). 2. Locate and click the following key in the registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Schedule 3. On the Edit menu, click Add Value, and then add the following registry values: Value Name. atTaskMaxHours Data type. reg_DWOrd Radix. Decimal Value Data: 0. A value of 0 in the Value Data field indicates no limit and doesn't not stop. Values from 1 through 99 indicates the number of hours. You can use the Scheduled Tasks folder to view or modify the settings of a task that was created by using this command. When you schedule a task using this command, the task is listed in the Scheduled Tasks folder, with a name such as the following:at3478. However, if you modify a task through the Scheduled Tasks folder, it's upgraded to a normal scheduled task. The task is no longer visible to the at command, and the at account setting no longer applies to it. You must explicitly enter a user account and password for the task. Examples To display a list of commands scheduled on the Marketing server, type: at \\marketing To learn more about a command with the identification number 3 on the Corp server, type: at \\corp 3 To schedule a net share command to run on the Corp server at 8:00 A.M. and redirect the listing to the Maintenance server, in the Reports shared directory, and the Corp.txt file, type: at \\corp 08:00 cmd /c net share reports=d:\marketing\reports >> \\maintenance\reports\corp.txt To back up the hard drive of the Marketing server to a tape drive at midnight every five days, create a batch program called Archive.cmd, which contains the backup commands, and then schedule the batch program to run, type: at \\marketing 00:00 /every:5,10,15,20,25,30 archive To cancel all commands scheduled on the current server, clear the at schedule information as follows: at /delete To run a command that is not an executable (.exe) file, precede the command with cmd /c to load cmd.exe as follows: cmd /c dir > c:\test.out Related links Command-Line Syntax Key schtasks. Another command-line scheduling tool. atmadm Article 02/03/2023 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Monitors connections and addresses that are registered by the atM call Manager on an asynchronous transfer mode (atM) network. You can use atmadm to display statistics for incoming and outgoing calls on atM adapters. Used without parameters, atmadm displays statistics for monitoring the status of active atM connections. Syntax atmadm [/c][/a][/s] Parameters Parameter Description /c Displays call information for all current connections to the atM network adapter installed on this computer. /a Displays the registered atM network service access point (NSAP) address for each adapter installed in this computer. /s Displays statistics for monitoring the status of active atM connections. /? Displays help at the command prompt. Remarks The atmadm /c command produces output similar to the following: Windows atM call Manager Statistics atM Connections on Interface : Olicom atM PCI 155 Adapter Connection VPI/VCI remote address/ Media Parameters (rates in bytes/sec) In PMP SVC 0/193 47000580FFE1000000F21A2E180020481A2E180B Tx:UBR,Peak 0,Avg 0,MaxSdu 1516 Rx:UBR,Peak 16953936,Avg 16953936,MaxSdu 1516 Out P-P SVC 0/192 47000580FFE1000000F21A2E180020481A2E180B Tx:UBR,Peak 16953936,Avg 16953936,MaxSdu 1516 Rx:UBR,Peak 16953936,Avg 16953936,MaxSdu 1516 In PMP SVC 0/191 47000580FFE1000000F21A2E180020481A2E180B Tx:UBR,Peak 0,Avg 0,MaxSdu 1516 Rx:UBR,Peak 16953936,Avg 16953936,MaxSdu 1516 Out P-P SVC 0/190 47000580FFE1000000F21A2E180020481A2E180B Tx:UBR,Peak 16953936,Avg 16953936,MaxSdu 1516 Rx:UBR,Peak 16953936,Avg 16953936,MaxSdu 1516 In P-P SVC 0/475 47000580FFE1000000F21A2E180000C110081501 Tx:UBR,Peak 16953984,Avg 16953984,MaxSdu 9188 Rx:UBR,Peak 16953936,Avg 16953936,MaxSdu 9188 Out PMP SVC 0/194 47000580FFE1000000F21A2E180000C110081501 (0) Tx:UBR,Peak 16953984,Avg 16953984,MaxSdu 9180 Rx:UBR,Peak 0,Avg 0,MaxSdu 0 Out P-P SVC 0/474 4700918100000000613E5BFE010000C110081500 Tx:UBR,Peak 16953984,Avg 16953984,MaxSdu 9188 Rx:UBR,Peak 16953984,Avg 16953984,MaxSdu 9188 In PMP SVC 0/195 47000580FFE1000000F21A2E180000C110081500 Tx:UBR,Peak 0,Avg 0,MaxSdu 0 Rx:UBR,Peak 16953936,Avg 16953936,MaxSdu 9180 The following table contains descriptions of each element in the atmadm /c sample output. Type of Data Screen Display Description Connection In/Out Direction of the call. In Information is to the atM network adapter from another device. Out is from the atM network adapter to another device. PMP Point-to-multipoint call. P-P Point-to-point call. SVC Connection is on a switched virtual circuit. PVC Connection is on a permanent virtual circuit. VPI/VCI VPI/VCI Virtual path and virtual Information channel of the incoming or outgoing call. Type of Data Screen Display Description Remote 47000580FFE1000000F21A2E180000C110081500 NSAP address of the address/Media calling (In) or called Parameters (Out) atM device. Tx The Tx parameter includes the following three elements: Default or specified bit-rate type (UBR, CBR, VBR, or ABR) Default or specified line speed Specified service data unit (SDU) size. Rx The Rx parameter includes the following three elements: Default or specified bit-rate type (UBR, CBR, VBR, or ABR) Default or specified line speed Specified SDU size. The atmadm /a command produces output similar to the following: Windows atM call Manager Statistics atM addresses for Interface : Olicom atM PCI 155 Adapter 47000580FFE1000000F21A2E180000C110081500 The atmadm /s command produces output similar to the following: Windows atM call Manager Statistics atM call Manager statistics for Interface : Olicom atM PCI 155 Adapter Current active calls = 4 Total successful Incoming calls = 1332 Total successful Outgoing calls = 1297 Unsuccessful Incoming calls = 1 Unsuccessful Outgoing calls = 1 calls Closed by remote = 1302 calls Closed Locally = 1323 Signaling and ILMI Packets Sent = 33655 Signaling and ILMI Packets Received = 34989 The following table contains descriptions of each element in the atmadm /s sample output. Call Manager Description Statistic Current active Calls currently active on the atM adapter installed on this computer. calls Total successful Calls successfully received from other devices on this atM network. Incoming calls Total successful Calls successfully completed to other atM devices on this network from Outgoing calls this computer. Unsuccessful Incoming calls that failed to connect to this computer. Incoming calls Unsuccessful Outgoing calls that failed to connect to another device on the network. Outgoing calls Calls Closed by Calls closed by a remote device on the network. remote Calls Closed Calls closed by this computer. Locally Signaling and Number of integrated local management interface (ILMI) packets sent ILMI Packets Sent to the switch to which this computer is attempting to connect. Signaling and Number of ILMI packets received from the atM switch. ILMI Packets Received Examples To display call information for all current connections to the atM network adapter installed on this computer, type: atmadm /c To display the registered atM network service access point (NSAP) address for each adapter installed in this computer, type: atmadm /a To display statistics for monitoring the status of active atM connections, type: atmadm /s Related links Command-Line Syntax Key attrib Article 09/25/2023 Displays, sets, or removes attributes assigned to files or directories. If used without parameters, attrib displays attributes of all files in the current directory. Syntax attrib [{+|-}r] [{+|-}a] [{+|-}s] [{+|-}h] [{+|-}o] [{+|-}i] [{+|-}x] [{+|-}p] [{+|-}u] [{+|-}b] [:][][] [/s [/d] [/l]] Parameters Parameter Description {+\|-}r Sets (+) or clears (-) the Read-only file attribute. {+\|-}a Sets (+) or clears (-) the Archive file attribute. This attribute set marks files that have changed since the last time they were backed up. The xcopy command uses archive attributes. {+\|-}s Sets (+) or clears (-) the System file attribute. If a file uses this attribute set, you must clear the attribute before you can change any other attributes for the file. {+\|-}h Sets (+) or clears (-) the Hidden file attribute. If a file uses this attribute set, you must clear the attribute before you can change any other attributes for the file. {+\|-}o Sets (+) or clears (-) the Offline file attribute. {+\|-}i Sets (+) or clears (-) the Not Content Indexed file attribute. {+\|-}x Sets (+) or clears (-) the Scrub file attribute. {+\|-}p Sets (+) or clears (-) the Pinned file attribute. {+\|-}u Sets (+) or clears (-) the Unpinned file attribute. {+\|-}b Sets (+) or clears (-) the SMR Blob file attribute. [:][] Specifies the location and name of the directory, file, or group of files that [] you want to view or change attributes. Parameter Description You can use the ? and * wildcard characters in the filename parameter to display or change the attributes for a group of files. /s Applies attrib and any command-line options to matching files in the current directory and all of its subdirectories. /d Applies attrib and any command-line options to directories. /l Applies attrib and any command-line options to the Symbolic Link, rather than the target of the Symbolic Link. /? Displays help at the command prompt. Examples To display the attributes of a file named News86 that is located in the current directory, type: attrib news86 To assign the Read-only attribute to the file named report.txt, type: attrib +r report.txt To remove the Read-only attribute from files in the public directory and its subdirectories on a disk in drive b:, type: attrib -r b:\public\*.* /s To set the Archive attribute for all files on drive a:, and then clear the Archive attribute for files with the.bak extension, type: attrib +a a:*.* & attrib -a a:*.bak Related links Command-Line Syntax Key xcopy command auditpol Article 02/03/2023 Displays information about and performs functions to manipulate audit policies, including: Setting and querying a system audit policy. Setting and querying a per-user audit policy. Setting and querying auditing options. Setting and querying the security descriptor used to delegate access to an audit policy. Reporting or backing up an audit policy to a comma-separated value (CSV) text file. Loading an audit policy from a CSV text file. Configuring global resource SACLs. Syntax auditpol command [] Parameters Sub- Description command /get Displays the current audit policy. For more information, see auditpol get for syntax and options. /set Sets the audit policy. For more information, see auditpol set for syntax and options. /list Displays selectable policy elements. For more information, see auditpol list for syntax and options. /backup Saves the audit policy to a file. For more information, see auditpol backup for syntax and options. Sub- Description command /restore Restores the audit policy from a file that was previously created by using auditpol /backup. For more information, see auditpol restore for syntax and options. /clear Clears the audit policy. For more information, see auditpol clear for syntax and options. /remove Removes all per-user audit policy settings and disables all system audit policy settings. For more information, see auditpol remove for syntax and options. /resourceSACL Configures global resource system access control lists (SACLs). Note: Applies only to Windows 7 and Windows Server 2008 R2. For more information, see auditpol resourceSACL. /? Displays help at the command prompt. Related links Command-Line Syntax Key auditpol backup Article 05/22/2023 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 The auditpol backup command backs up system audit policy settings, per-user audit policy settings for all users, and all auditing options to a comma-separated value (CSV) text file. To perform backup operations on the per-user and system policies, you need Write or Full Control permissions for that object set in the security descriptor. You can also perform backup operations if you have the Manage auditing and security log (SeSecurityPrivilege) user right. However, this right allows access that isn't necessary to perform the overall backup operations. Syntax auditpol /backup /file: Parameters Parameter Description /file Specifies the file name of the for the back up. /? Displays help at the command prompt. Examples You can back up the following settings to a CSV-formatted text file: Per-user audit policy settings for all users System audit policy settings All auditing options To back up these settings to a file named auditpolicy.csv, type the following command: auditpol /backup /file:C:\auditpolicy.csv 7 Note If no drive is specified, the current directory is used. Related links Command-Line Syntax Key auditpol restore auditpol commands auditpol clear Article 02/03/2023 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Deletes the per-user audit policy for all users, resets (disables) the system audit policy for all subcategories, and sets all the auditing options to disabled. To perform clear operations on the per-user and system policies, you must have Write or Full Control permission for that object set in the security descriptor. You can also perform clear operations if you have the Manage auditing and security log (SeSecurityPrivilege) user right. However, this right allows additional access that is not necessary to perform the overall clear operations. Syntax auditpol /clear [/y] Parameters Parameter Description /y Suppresses the prompt to confirm if all audit policy settings should be cleared. /? Displays help at the command prompt. Examples To delete the per-user audit policy for all users, reset (disable) the system audit policy for all subcategories, and set all the audit policy settings to disabled, at a confirmation prompt, type: auditpol /clear To delete the per-user audit policy for all users, reset the system audit policy settings for all subcategories, and set all the audit policy settings to disabled, without a confirmation prompt, type: auditpol /clear /y 7 Note The preceding example is useful when using a script to perform this operation. Related links Command-Line Syntax Key auditpol commands auditpol get Article 02/03/2023 Applies to: Windows Server 2022, Windows Server 2019, Windows Server, 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Retrieves the system policy, per-user policy, auditing options, and audit security descriptor object. To perform get operations on the per-user and system policies, you must have Read permission for that object set in the security descriptor. You can also perform get operations if you have the Manage auditing and security log (SeSecurityPrivilege) user right. However, this right allows additional access that is not necessary to perform the overall get operations. Syntax auditpol /get [/user[:|]] [/category:*||[,: character. For example: > To use multiple commands for , separate them by the command separator &&. For example: &&&& If the directory path, files, or any information you supply contains spaces, you must use double quotation marks ( " ) around the text, such as "Computer Name". For example: mkdir Test&&mkdir "Test 2"&&move "Test 2" Test You must use quotation marks around the following special characters: & < > [ ] | { } ^ = ; ! ' + , ` ~ [white space]. If you specify /c or /k , the cmd processes, the remainder of , and the quotation marks are preserved only if all of the following conditions are met: You don't also use /s. You use exactly one set of quotation marks. You don't use any special characters within the quotation marks (for example: & < > ( ) @ ^ | ). You use one or more white-space characters within the quotation marks. The within quotation marks is the name of an executable file. If the previous conditions aren't met, is processed by examining the first character to verify whether it's an opening quotation mark. If the first character is an opening quotation mark, it's stripped along with the closing quotation mark. Any text following the closing quotation marks is preserved. If you don't specify /d , Cmd.exe looks for the following registry subkeys: HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun\REG_SZ HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun\REG_EXPAND_SZ If one or both registry subkeys are present, they're executed before all other variables. U Caution Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer. You can disable command extensions for a particular process by using /e:off. You can enable or disable extensions for all cmd command-line options on a computer or user session by setting the following REG_DWORD values: HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions\REG_DWORD HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions\REG_DWORD Set the REG_DWORD value to either 0×1 (enabled) or 0×0 (disabled) in the registry by using Regedit.exe. User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings. U Caution Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer. When you enable command extensions, the following commands are affected: assoc call chdir ( cd ) color del ( erase ) endlocal for ftype goto if mkdir ( md ) popd prompt pushd set setlocal shift start (also includes changes to external command processes) If you enable delayed environment variable expansion, you can use the exclamation point character ( ! ) to substitute the value of an environment variable at run time. File and directory name completion isn't enabled by default. You can enable or disable file name completion for a particular process of the cmd command with /f:{on | off}. You can enable or disable file and directory name completion for all processes of the cmd command on a computer or for a user logon session by setting the following REG_DWORD values: HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar\REG_DWORD HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar\REG_DWORD HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar\REG_DWORD HKEY_CURRENT_USER\Software\Microsoft\Command Processor\PathCompletionChar\REG_DWORD To set the REG_DWORD value, run Regedit.exe and use the hexadecimal value of a control character for a particular function (for example, 0×9 is TAB and 0×08 is BACKSPACE). Use the [0×20] value for white space, because it isn't a valid control character. User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings. U Caution Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer. If you enable file and directory name completion by using /f:on , use CTRL+D for directory name completion and CTRL+F for file name completion. The only difference between the key combinations CTRL+D and CTRL+F is that CTRL+D only matches directory names and CTRL+F matches both file and directory names. If you use file and directory name completion on the built-in directory commands cd , md , or rd , directory completion is assumed. Pressing CTRL+D or CTRL+F processes the file and directory name completion. These key combination functions append a wildcard character to if one isn't present, build a list of paths that match, and then display the first matching path. If none of the paths match, the file and directory name completion function beeps and doesn't change the display. To move through the list of matching paths, press CTRL+D or CTRL+F repeatedly. To move through the list backwards, press the SHIFT key and CTRL+D or CTRL+F simultaneously. To discard the saved list of matching paths and generate a new list, edit and press CTRL+D or CTRL+F. If you switch between CTRL+D and CTRL+F, the saved list of matching paths is discarded, and a new list is generated. File and directory name completion correctly processes file names that contain white space or special characters if you place quotation marks around the matching path. If you process file and directory name completion from within , at the point in where the completion was processed, any part of the path to the right of the cursor is discarded. Related links Command-Line Syntax Key cmdkey Article 02/03/2023 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Creates, lists, and deletes stored user names and passwords or credentials. Syntax cmdkey [{/add:|/generic:}] {/smartcard | /user: [/pass:]} [/delete{: | /ras}] /list: Parameters Parameters Description /add: Adds a user name and password to the list. Requires the parameter of which identifies the computer or domain name that this entry will be associated with. /generic: Adds generic credentials to the list. Requires the parameter of which identifies the computer or domain name that this entry will be associated with. /smartcard Retrieves the credential from a smart card. If more than one smart card is found on the system when this option is used, cmdkey displays information about all available smart cards, and then prompts the user to specify which one to use. /user: Specifies the user or account name to store with this entry. If isn't supplied, it will be requested. /pass: Specifies the password to store with this entry. If isn't supplied, it will be requested. Passwords are not displayed after they're stored. /delete: { Deletes a user name and password from the list. If is \| /ras} specified, that entry is deleted. If /ras is specified, the stored remote access entry is deleted. Parameters Description /list: Displays the list of stored user names and credentials. If isn't specified, all stored user names and credentials are listed. /? Displays help at the command prompt. Examples To display a list of all user names and credentials that are stored, type: cmdkey /list To add a user name and password for user Mikedan to access computer Server01 with the password Kleo, type: cmdkey /add:server01 /user:mikedan /pass:Kleo To add a user name and password for user Mikedan to access computer Server01 and prompt for the password whenever Server01 is accessed, type: cmdkey /add:server01 /user:mikedan To delete a credential stored by remote access, type: cmdkey /delete /ras To delete a credential stored for Server01, type: cmdkey /delete:server01 Related links Command-Line Syntax Key cmstp Article 02/03/2023 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Installs or removes a Connection Manager service profile. Used without optional parameters, cmstp installs a service profile with default settings appropriate to the operating system and to the user's permissions. Syntax Syntax 1 - This is the typical syntax used in a custom installation application. To use this syntax, you must run cmstp from the directory that contains the.exe file..exe /q:a /c:cmstp.exe.inf [/nf] [/s] [/u] Syntax 2 cmstp.exe [/nf] [/s] [/u] [drive:][path]serviceprofilefilename.inf Parameters Parameter Description.exe Specifies, by name, the installation package that contains the profile that you want to install. Required for Syntax 1, but not valid for Syntax 2. /q:a Specifies that the profile should be installed without prompting the user. The verification message that the installation has succeeded will still appear. Required for Syntax 1, but not valid for Syntax 2. Parameter Description [drive:][path] Required. Specifies, by name, the configuration file that.inf determines how the profile should be installed. The [drive:][path] parameter isn't valid for Syntax 1. /nf Specifies that the support files should not be installed. /s Specifies that the service profile should be installed or uninstalled silently (without prompting for user response or displaying verification message). This is the only parameter that you can use in combination with /u. /u Specifies that the service profile should be uninstalled. /? Displays help at the command prompt. Examples To install the fiction service profile without any support files, type: fiction.exe /c:cmstp.exe fiction.inf /nf To silently install the fiction service profile for a single user, type: fiction.exe /c:cmstp.exe fiction.inf /s /su To silently uninstall the fiction service profile, type: fiction.exe /c:cmstp.exe fiction.inf /s /u Related links Command-Line Syntax Key color Article 09/20/2023 Changes the foreground and background colors in the Command Prompt window for the current session. If used without parameters, color restores the default Command Prompt window foreground and background colors. Syntax Windows Command Prompt color [attr] Parameters Parameter Description attr Specifies color attribute of console output. /? Displays help at the command prompt. The following table lists valid hexadecimal digits that you can use as the values for attr : Value Color 0 Black 1 Blue 2 Green 3 Aqua 4 Red 5 Purple 6 Yellow 7 White 8 Gray 9 Light blue Value Color a Light green b Light aqua c Light red d Light purple e Light yellow f Bright white Remarks You can specify one or two hexadecimal digits. The first is used as the foreground color and the second is used as the background color. If you specify two hexadecimal digits, don't use space characters between them. If you specify only one hexadecimal digit, the corresponding color is used as the foreground color and the background color is set to the default color. To set the default Command Prompt window color, select the upper-left corner of the Command Prompt window, select Defaults, select the Colors tab, and then select the colors that you want to use for the Screen Text and Screen Background. If you specify the same value for two hexadecimal digits, the ERRORLEVEL is set to 1 and no change is made to either the foreground or the background color. Examples To change the Command Prompt window background color to gray and the foreground color to red, type: Windows Command Prompt color 84 To change the Command Prompt window foreground color to light yellow, type: Windows Command Prompt color e 7 Note In this example, the background is set to the default color because only one hexadecimal digit is specified. Related links Command-Line Syntax Key comp Article 02/03/2023 Compares the contents of two files or sets of files byte-by-byte. These files can be stored on the same drive or on different drives, and in the same directory or in different directories. When this command compares files, it displays their location and file names. If used without parameters, comp prompts you to enter the files to compare. Syntax comp [] [] [/d] [/a] [/l] [/n=] [/c] Parameters Parameter Description Specifies the location and name of the first file or set of files that you want to compare. You can use wildcard characters (* and ?) to specify multiple files. Specifies the location and name of the second file or set of files that you want to compare. You can use wildcard characters (* and ?) to specify multiple files. /d Displays differences in decimal format. (The default format is hexadecimal.) /a Displays differences as characters. /l Displays the number of the line where a difference occurs, instead of displaying the byte offset. /n= Compares only the number of lines that are specified for each file, even if the files are different sizes. /c Performs a comparison that is not case-sensitive. /off[line] Processes files with the offline attribute set. /? Displays Help at the command prompt. Remarks During the comparison, comp displays messages that identify the locations of unequal information between the files. Each message indicates the offset memory address of the unequal bytes and the contents of the bytes (in hexadecimal notation unless the /a or /d command-line parameter is specified). Messages appear in the following format: Compare error at OFFSET xxxxxxxx file1 = xx file2 = xx After ten unequal comparisons, comp stops comparing the files and displays the following message: 10 Mismatches - ending compare If you omit necessary components of either data1 or data2, or if you omit data2 entirely, this command prompts you for the missing information. If data1 contains only a drive letter or a directory name with no file name, this command compares all of the files in the specified directory to the file specified in data1. If data2 contains only a drive letter or a directory name, the default file name for data2 becomes the same name as for data1. If the comp command can't find the specified files, it will prompt you with a message about whether you want to compare additional files. The files that you compare can have the same file name, provided they're in different directories or on different drives. You can use wildcard characters (* and ?) to specify file names. You must specify /n to compare files of different sizes. If the file sizes are different and /n isn't specified, the following message is displayed: Files are different sizes Compare more files (Y/N)? To compare these files anyway, press N to stop the command. Then, run the comp command again, using the /n option to compare only the first portion of each file. If you use wildcard characters (* and ?) to specify multiple files, comp finds the first file that matches data1 and compares it with the corresponding file in data2, if it exists. The comp command reports the results of the comparison for each file matching data1. When finished, comp displays the following message: Compare more files (Y/N)? To compare more files, press Y. The comp command prompts you for the locations and names of the new files. To stop the comparisons, press N. When you press Y, you're prompted for which command-line options to use. If you don't specify any command-line options, comp uses the ones you specified before. Examples To compare the contents of the directory c:\reports with the backup directory \\sales\backup\april , type: comp c:\reports \\sales\backup\april To compare the first ten lines of the text files in the \invoice directory and display the result in decimal format, type: comp \invoice\*.txt \invoice\backup\*.txt /n=10 /d Related links Command-Line Syntax Key compact Article 02/03/2023 Displays or alters the compression of files or directories on NTFS partitions. If used without parameters, compact displays the compression state of the current directory and any files it contains. Syntax compact [/C | /U] [/S[:dir]] [/A] [/I] [/F] [/Q] [/EXE[:algorithm]] [/CompactOs[:option] [/windir:dir]] [filename [...]] Parameters Parameter Description /c Compresses the specified directory or file. Directories are marked so any files added afterwards are compressed, unless the /EXE parameter is specified. /u Uncompresses the specified directory or file. Directories are marked so any files added afterwards aren't compressed. If the /EXE parameter is specified, only files compressed as executables are uncompressed; if you don't specify the /EXE parameter, only NTFS compressed files are uncompressed. /s [:] Performs the chosen operation on files in the specified directory and all subdirectories. By default, the current directory is used as the value. /a Displays hidden or system files. By default, these files aren't included. /i Continues performing the specified operation, ignoring errors. By default, this command stops when an error is encountered. /f Forces compression or uncompression of the specified directory or file. Already- compressed files are skipped by default. The /f parameter is used in the case of a file that was partly compressed when the operation was interrupted by a system crash. To force the file to be compressed in its entirety, use the /c and /f parameters and specify the partially compressed file. /q Reports only the most essential information. Parameter Description /EXE Uses compression optimized for executable files that are read frequently, but not modified. Supported algorithms are: XPRESS4K (fastest and default value) XPRESS8K XPRESS16K LZX (most compact) /CompactOs Sets or queries the system's compression state. Supported options are: query - Queries the system's Compact state. always - Compresses all operating system binaries and sets the system state to Compact, which remains unless administrator changes it. never - Uncompresses all operating system binaries and sets the system state to non-Compact, which remains unless administrator changes it. /windir Used with the /CompactOs:query parameter, when querying the offline operating system. Specifies the directory where Windows is installed. Specifies a pattern, file, or directory. You can use multiple file names, and the * and ? wildcard characters. /? Displays help at the command prompt. Remarks This command is the command-line version of the NTFS file system compression feature. The compression state of a directory indicates whether files are automatically compressed when they are added to the directory. Setting the compression state of a directory does not necessarily change the compression state of files that are already in the directory. You can't use this command to read, write, or mount volumes compressed using DriveSpace or DoubleSpace. You also can't use this command to compress file allocation table (FAT) or FAT32 partitions. Examples To set the compression state of the current directory, its subdirectories, and existing files, type: compact /c /s To set the compression state of files and subdirectories within the current directory, without altering the compression state of the current directory itself, type: compact /c /s *.* To compress a volume, from the root directory of the volume, type: compact /c /i /s:\ 7 Note This example sets the compression state of all directories (including the root directory on the volume) and compresses every file on the volume. The /i parameter prevents error messages from interrupting the compression process. To compress all files with the.bmp file name extension in the \tmp directory and all subdirectories of \tmp, without modifying the compressed attribute of the directories, type: compact /c /s:\tmp *.bmp To force complete compression of the file zebra.bmp, which was partially compressed during a system crash, type: compact /c /f zebra.bmp To remove the compressed attribute from the directory c:\tmp, without changing the compression state of any files in that directory, type: compact /u c:\tmp Related links Command-Line Syntax Key copy Article 02/03/2023 Copies one or more files from one location to another. 7 Note You can also use the copy command, with different parameters, from the Recovery Console. For more information about the recovery console, see Windows Recovery Environment (Windows RE). Syntax copy [/d] [/v] [/n] [/y | /-y] [/z] [/a | /b] [/a | /b] [+ [/a | /b] [+...]] [ [/a | /b]] Parameters Parameter Description /d Allows the encrypted files being copied to be saved as decrypted files at the destination. /v Verifies that new files are written correctly. /n Uses a short file name, if available, when copying a file with a name longer than eight characters, or with a file name extension longer than three characters. /y Suppresses prompting to confirm that you want to overwrite an existing destination file. /-y Prompts you to confirm that you want to overwrite an existing destination file. /z Copies networked files in restartable mode. /a Indicates an ASCII text file. /b Indicates a binary file. Parameter Description Required. Specifies the location from which you want to copy a file or set of files. Source can consist of a drive letter and colon, a directory name, a file name, or a combination of these. Required. Specifies the location to which you want to copy a file or set of files. Destination can consist of a drive letter and colon, a directory name, a file name, or a combination of these. /? Displays help at the command prompt. Remarks You can copy an ASCII text file that uses an end-of-file character (CTRL+Z) to indicate the end of the file. If /a precedes or follows a list of files on the command line, it applies to all files listed until copy encounters /b. In this case, /b applies to the file preceding /b. The effect of /a depends on its position in the command-line string: - If /a follows source, the copy command treats the file as an ASCII file and copies data that precedes the first end-of-file character (CTRL+Z). - If /a follows destination, the copy command adds an end-of-file character (CTRL+Z) as the last character of the file. If /b directs the command interpreter to read the number of bytes specified by the file size in the directory. /b is the default value for copy, unless copy combines files. If /b precedes or follows a list of files on the command line, it applies to all listed files until copy encounters /a. In this case, /a applies to the file preceding /a. The effect of /b depends on its position in the command–line string: - If /b follows source, the copy command copies the entire file, including any end-of-file character (CTRL+Z). - If /b follows destination, the copy command doesn't add an end-of-file character (CTRL+Z). If a write operation cannot be verified, an error message appears. Although recording errors rarely occur with the copy command , you can use /v to verify that critical data has been correctly recorded. The /v command-line option also slows down the copy command, because each sector recorded on the disk must be checked. If /y is preset in the COPYCMD environment variable, you can override this setting by using /-y at the command line. By default, you are prompted when you replace this setting, unless the copy command is executed in a batch script. To append files, specify a single file for destination, but multiple files for source (use wildcard characters or file1+file2+file3 format). If the connection is lost during the copy phase (for example, if the server going offline breaks the connection), you can use copy /z to resume after the connection is re-established. The /z option also displays the percentage of the copy operation that is completed for each file. You can substitute a device name for one or more occurrences of source or destination. If destination is a device (for example, Com1 or Lpt1), the /b option copies data to the device in binary mode. In binary mode, copy /b copies all characters (including special characters such as CTRL+C, CTRL+S, CTRL+Z, and ENTER) to the device, as data. However, if you omit /b, the data is copied to the device in ASCII mode. In ASCII mode, special characters might cause files to combine during the copying process. If you don't specify a destination file, a copy is created with the same name, modified date, and modified time as the original file. The new copy is stored in the current directory on the current drive. If the source file is on the current drive and in the current directory and you do not specify a different drive or directory for the destination file, the copy command stops and displays the following error message: File cannot be copied onto itself 0 File(s) copied If you specify more than one file in source, the copy command combines them all into a single file using the file name specified in destination. The copy command assumes the combined files are ASCII files unless you use the /b option. To copy files that are 0 bytes long, or to copy all of a directory's files and subdirectories, use the xcopy command. To assign the current time and date to a file without modifying the file, use the following syntax: copy /b +,, Where the commas indicate that the destination parameter has been intentionally left out. Examples To copy a file called memo.doc to letter.doc in the current drive and ensure that an end- of-file character (CTRL+Z) is at the end of the copied file, type: copy memo.doc letter.doc /a To copy a file named robin.typ from the current drive and directory to an existing directory named Birds that is located on drive C, type: copy robin.typ c:\birds 7 Note If the Birds directory doesn't exist, the file robin.typ is copied into a file named Birds that is located in the root directory on the disk in drive C. To combine Mar89.rpt, Apr89.rpt, and May89.rpt, which are located in the current directory, and place them in a file named Report (also in the current directory), type: copy mar89.rpt + apr89.rpt + may89.rpt Report 7 Note If you combine files, the copy command marks the destination file with the current date and time. If you omit destination, the files are combined and stored under the name of the first file in the list. To combine all files in Report, when a file named Report already exists, type: copy report + mar89.rpt + apr89.rpt + may89.rpt To combine all files in the current directory that have the.txt file name extension into a single file named Combined.doc, type: copy *.txt Combined.doc To combine several binary files into one file by using wildcard characters, include /b. This prevents Windows from treating CTRL+Z as an end-of-file character. For example, type: copy /b *.exe Combined.exe U Caution If you combine binary files, the resulting file might be unusable due to internal formatting. Combining each file that has a.txt extension with its corresponding.ref file creates a file with the same file name, but with a.doc extension. The Copy command combines file1.txt with file1.ref to form file1.doc, and then the command combines file2.txt with file2.ref to form file2.doc, and so on. For example, type: copy *.txt + *.ref *.doc To combine all files with the.txt extension, and then to combine all files with the.ref extension into one file named Combined.doc, type: copy *.txt + *.ref Combined.doc Related links Command-Line Syntax Key xcopy command cscript Article 02/03/2023 Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012 Starts a script to run in a command-line environment. ) Important Performing this task does not require you to have administrative credentials. Therefore, as a security best practice, consider performing this task as a user without administrative credentials. Syntax cscript [/b] [/d] [/e:] [{/h:cscript | /h:wscript}] [/i] [/job:] [{/logo | /nologo}] [/s] [/t: ] [x] [/u] [/?] [] Parameters Parameter Description scriptname.extension Specifies the path and file name of the script file with optional file name extension. /b Specifies batch mode, which does not display alerts, scripting errors, or input prompts. /d Starts the debugger. /e: Specifies the engine that is used to run the script. /h:cscript Registers cscript.exe as the default script host for running scripts. /h:wscript Registers wscript.exe as the default script host for running scripts. The default. Parameter Description /i Specifies interactive mode, which displays alerts, scripting errors, and input prompts. The default, and the opposite of /b. /job: Runs the job identified by identifier in a.wsf script file. /logo Specifies that the Windows Script Host banner is displayed in the console before the script runs. The default, and the opposite of /nologo. /nologo Specifies that the Windows Script Host banner is not displayed before the script runs. /s Saves the current command-prompt options for the current user. /t: Specifies the maximum time the script can run (in seconds). You can specify up to 32,767 seconds. The default is no time limit. /u Specifies Unicode for input and output that is redirected from the console. /x Starts the script in the debugger. /? Displays available command parameters and provides help for using them. The same as typing cscript.exe with no parameters and no script. scriptarguments Specifies the arguments passed to the script. Each script argument must be preceded by a slash (/). Remarks Each parameter is optional; however, you can't specify script arguments without specifying a script. If you don't specify a script or any script arguments, cscript.exe displays the cscript.exe syntax and the valid host options. The /t parameter prevents excessive running of scripts by setting a timer. When the run time exceeds the specified value, cscript interrupts the script engine and ends the process. Windows script files usually have one of the following file name extensions:.wsf,.vbs,.js. Windows Script Host can use.wsf script files. Each.wsf file can use multiple scripting engines and perform multiple jobs. if you double-click a script file with an extension that has no association, the Open With dialog box appears. Select wscript or cscript, and then select Always use this program to open this file type. This registers wscript.exe or cscript as the default script host for files of this file type. Related links Command-Line Syntax Key date Article 02/03/2023 Displays or sets the system date. If used without parameters, date displays the current system date setting and prompts you to enter a new date. ) Important You must be an administrator to use this command. Syntax date [/t | ] Parameters Parameter Description values 1 through 12), day