Applies to: Windows Server 2022, Windows Server 2019, Windows 10, Azure Stack HCI, Azure Stack Hub, Azure
Packet Monitor (Pktmon) is an in-box, cross-component network diagnostics tool for Windows. It can be used for advanced packet capture and event collection, drop detection, filtering, and counting. Pktmon is especially helpful in virtualization scenarios such as container networking and SDN, because it provides visibility within the networking stack.
pktmon { filter | list | start | stop | status | unload | counters | reset | etl2txt | etl2pcap | hex2pkt | help } [options]
Command | Description |
---|---|
pktmon filter | Manage packet filters. |
pktmon list | List packet processing components. |
pktmon start | Start packet capture and event collection. |
pktmon stop | Stop data collection. |
pktmon status | Query current status. |
pktmon unload | Unload PktMon driver. |
pktmon counters | Display current packet counters. |
pktmon reset | Reset packet counters to zero. |
pktmon etl2txt | Convert log file to text format. |
pktmon etl2pcap | Convert log file to pcapng format. |
pktmon hex2pkt | Decode packet in hexadecimal format. |
pktmon help | Show help text for specific command. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2
[!IMPORTANT] This command has been deprecated.
Administers phone books. Used without parameters, pbadmin starts Phone Book Administrator. For descriptions and usage information, see pbadmin.
Start Windows Reliability and Performance Monitor in a specific standalone mode.
perfmon </res|report|rel|sys>
Parameter | Description |
---|---|
/res | Starts the Resource View. |
/report | Starts the System Diagnostics Data Collector Set and displays a report of the results. |
/rel | Starts the Reliability Monitor. |
/sys | Starts the Performance Monitor. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2
[!IMPORTANT] This command has been deprecated.
Enables an administrator to display and configure a system's paging file Virtual Memory settings. For descriptions and usage information, see pagefileconfig.
Takes the online volume with focus to the offline state.
[!NOTE] A volume must be selected for the offline volume command to succeed. Use the select volume command to select a disk and shift the focus to it.
offline volume [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To take the disk with focus offline, type:
offline volume
Takes an offline disk or volume to the online state.
online disk
online volume
Parameter | Description |
---|---|
online disk | Takes the offline disk with focus to the online state. |
online volume | Takes the offline volume with focus to the online state. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Dumps the internal tables, thread, and memory information for the NT File Replication Service (NTFRS) from both the local and remote servers. The recovery setting for NTFRS in Service Control Manager (SCM) can be critical to locating and keeping important log events on the computer. This tool provides a convenient method of reviewing those settings.
ntfrsutl[idtable|configtable|inlog|outlog][<computer>]
ntfrsutl[memory|threads|stage][<computer>]
ntfrsutl ds[<computer>]
ntfrsutl [sets][<computer>]
ntfrsutl [version][<computer>]
ntfrsutl poll[/quickly[=[<n>]]][/slowly[=[<n>]]][/now][<computer>]
Parameter | Description |
---|---|
idtable | Specifies the ID table. |
configtable | Specifies the FRS configuration table. |
inlog | Specifies the inbound log. |
outlog | Specifies the outbound log. |
<computer> |
Specifies the computer. |
memory | Specifies the memory usage. |
threads | Specifies the memory usage. |
stage | Specifies the memory usage. |
ds | Lists the NTFRS service's view of the DS. |
sets | Specifies the active replica sets. |
version | Specifies the API and NTFRS service versions. |
poll | Specifies the current polling intervals.
|
/? | Displays help at the command prompt. |
To determine the polling interval for file replication, type:
C:\Program Files\SupportTools>ntfrsutl poll wrkstn-1
To determine the current NTFRS application program interface (API) version, type:
C:\Program Files\SupportTools>ntfrsutl version
Takes an online disk or volume to the offline state.
offline disk
offline volume
Parameter | Description |
---|---|
offline disk | Takes the online disk with focus to the offline state. |
offline volume | Takes the online volume with focus to the offline state. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Runs the command interpreter Cmd.exe, rather than Command.com, after running a Terminate and Stay Resident (TSR) or after starting the command prompt from within an MS-DOS application.
ntcmdprompt
Parameter | Description |
---|---|
/? | Displays help at the command prompt. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
If a reply isn't received within a certain amount of time, the time-out period is doubled, and the request is resent. This command sets the number of times a request is resent to a server for information, before giving up.
[!NOTE] To change the length of time before the request times out, use the nslookup set timeout command.
set retry=<number>
Parameter | Description |
---|---|
<number> |
Specifies the new value for the number of retries. The default number of retries is 4. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
title: nslookup set recurse description: Reference article for the nslookup set recurse command, which tells the Domain Name System (DNS) name server to query other servers if it can't find the information on the specified server.
Tells the Domain Name System (DNS) name server to query other servers if it can't find the information on the specified server.
set [no]recurse
Parameter | Description |
---|---|
norecurse | Stops the Domain Name System (DNS) name server from querying other servers if it can't find the information on the specified server. |
recurse | Tells the Domain Name System (DNS) name server to query other servers if it can't find the information on the specified server. This is the default value. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the default Domain Name System (DNS) domain name to the specified name.
set domain=<domainname>
Parameter | Description |
---|---|
<domainname> |
Specifies a new name for the default DNS domain name. The default value is the name of the host. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
The default DNS domain name is appended to a lookup request depending on the state of the defname and search options.
The DNS domain search list contains the parents of the default DNS domain if it has at least two components in its name. For example, if the default DNS domain is mfg.widgets.com, the search list is named both mfg.widgets.com and widgets.com.
Use the nslookup set srchlist command to specify a different list and the nslookup set all command to display the list.
Changes the query class. The class specifies the protocol group of the information.
set class=<class>
Parameter | Description |
---|---|
<class> |
The valid values include:
|
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Turns debugging mode on or off.
set [no]debug
Parameter | Description |
---|---|
nodebug | Turns off debugging mode. This is the default value. |
debug | Turns on debugging mode. By turning debugging mode on, you can view more information about the packet sent to the server and the resulting answer. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Turns the verbose debugging mode on or off. All fields of every packet are printed.
set [no]d2
Parameter | Description |
---|---|
nod2 | Turns off the verbose debugging mode. This is the default value. |
d2 | Turns on the verbose debugging mode. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Outputs the current configuration setting values, including the default server and computer (the host).
set all
Parameter | Description |
---|---|
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the default server to the specified Domain Name System (DNS) domain.
This command uses the current default server to look up the information about the specified DNS domain. If you want to lookup information using the initial server, use the nslookup lserver command.
server <DNSdomain>
Parameter | Description |
---|---|
<DNSdomain> |
Specifies the DNS domain for the default server. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the initial server to the specified Domain Name System (DNS) domain.
This command uses the initial server to look up the information about the specified DSN domain. If you want to lookup information using the current default server, use the nslookup server command.
lserver <DNSdomain>
Parameter | Description |
---|---|
<DNSdomain> |
Specifies the DNS domain for the initial server. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
A command-line utility that displays statistical info about the Network File System (NFS) and Remote Procedure Call (RPC) calls. Used without parameters, this command displays all of the statistical data without resetting anything.
nfsstat [-c][-s][-n][-r][-z][-m]
Parameter | Description |
---|---|
-c | Displays only the client-side NFS and RPC and NFS calls sent and rejected by the client. To display NFS or RPC information only, combine this flag with the -n or -r parameter. |
-s | Displays only the server-side NFS and RPC and NFS calls sent and rejected by the server. To display NFS or RPC information only, combine this flag with the -n or -r parameter. |
-m | Displays information about mount flags set by mount options, mount flags internal to the system, and other mount information. |
-n | Displays NFS information for both the client and server. To display only the NFS client or server information, combine this flag with the -c or -s parameter. |
-r | Displays RPC information for both the client and server. To display only the RPC client or server information, combine this flag with the -c or -s parameter. |
-z | Resets the call statistics. This flag is only available to the root user and can be combined with any of the other parameters to reset particular sets of statistics after displaying them. |
To display information about the number of RPC and NFS calls sent and rejected by the client, type:
nfsstat -c
To display and print the client NFS call-related information, type:
nfsstat -cn
To display RPC call-related information for both the client and server, type:
nfsstat -r
To display information about the number of RPC and NFS calls received and rejected by the server, type:
nfsstat -s
To reset all call-related information to zero on the client and server, type:
nfsstat -z
title: winnt description: Reference article for winnt, which is deprecated, and is not guaranteed to be supported in future releases of Windows.
Winnt is deprecated, and is not guaranteed to be supported in future releases of Windows.
This tool is included in Windows Server 2003. For more information, see Winnt.
Displays the location of files that match the given search pattern.
where [/r <Dir>] [/q] [/f] [/t] [$<ENV>:|<Path>:]<Pattern>[ ...]
Parameter | Description |
---|---|
/r <Dir> | Indicates a recursive search, starting with the specified directory. |
/q | Returns an exit code (0 for success, 1 for failure) without displaying the list of matched files. |
/f | Displays the results of the where command in quotation marks. |
/t | Displays the file size and the last modified date and time of each matched file. |
[$<ENV>:|<Path>:]<Pattern>[ ...] | Specifies the search pattern for the files to match. At least one pattern is required, and the pattern can include wildcard characters (* and ?). By default, where searches the current directory and the paths that are specified in the PATH environment variable. You can specify a different path to search by using the format $ENV:Pattern (where ENV is an existing environment variable containing one or more paths) or by using the format Path:Pattern (where Path is the directory path you want to search). These optional formats should not be used with the /r command-line option. |
/? | Displays help at the command prompt. |
To find all files named Test in drive C of the current computer and its subdirectories, type:
where /r c:\ test
To list all files in the Public directory, type:
where $public:*.*
To find all files named Notepad in drive C of the remote computer, Computer1, and its subdirectories, type:
where /r \\computer1\c notepad.*
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Starts a Scheduled-Cast namespace.
wdsutil /start-Namespace /Namespace:<Namespace name[/Server:<Server name>]
Parameter | Description |
---|---|
/Namespace:<Namespace name> | Specifies the name of the namespace. Note that this is not the friendly name, and it must be unique. - Deployment Server: The syntax for namespace name is /Namspace:WDS:<Image group>/<Image name>/<Index>. For example: WDS:ImageGroup1/install.wim/1 |
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
To start a namespace, type one of the following:
wdsutil /start-Namespace /Namespace:Custom Auto 1
wdsutil /start-Namespace /Server:MyWDSServer /Namespace:Custom Auto 1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the attributes of an image group.
wdsutil [Options] /set-imagegroup:<Image group name> [/Server:<Server name>] [/Name:<New image group name>] [/Security:<SDDL>]
Parameter | Description |
---|---|
/set-imagegroup:<Image group name> | Specifies the name of the image group. |
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If not specified, the local server will be used. |
[/Name:<New image group name>] | Specifies the new name of the image group. |
[/Security:<SDDL>] | Specifies the new Security Descriptor of the image group, in security descriptor definition language (SDDL) format. |
To set the name for an image group, type:
wdsutil /Set-ImageGroup:ImageGroup1 /Name:New Image Group Name
To specify various settings for an image group, type:
wdsutil /verbose /Set-ImageGroupGroup:ImageGroup1 /Server:MyWDSServer /Name:New Image Group Name
/Security:O:BAG:S-1-5-21-2176941838-3499754553-4071289181-513 D:AI(A;ID;FA;;;SY)(A;OICIIOID;GA;;;SY)(A;ID;FA;;;BA)(A;OICIIOID;GA;;;BA) (A;ID;0x1200a9;;;AU)(A;OICIIOID;GXGR;;;AU)
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sets the properties of an existing driver group on a server.
wdsutil /Set-DriverGroup /DriverGroup:<Group Name> [/Server:<Server Name>] [/Name:<New Group Name>] [/Enabled:{Yes | No}] [/Applicability:{Matched | All}]
Parameter | Description |
---|---|
/DriverGroup:<Group Name> | Specifies the name of the driver group. |
[/Server:<Server name>] | Specifies the name of the server. This can be the NetBIOS name or the FQDN. If a server name is not specified, the local server is used. |
[/Name:<New Group Name>] | Specifies the new name for the driver group. |
[/Enabled:{Yes | No} | Enables or disables the driver group. |
[/Applicability:{Matched | All}] | Specifies which packages to install if the filter criteria is met. Matched means install only the driver packages that match a client s hardware. All means install all packages to clients regardless of their hardware. |
To set the properties for a driver group, type one of the following:
wdsutil /Set-DriverGroup /DriverGroup:printerdrivers /Enabled:Yes
wdsutil /Set-DriverGroup /DriverGroup:printerdrivers /Name:colorprinterdrivers /Applicability:All
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Removes an image group from a server.
wdsutil [Options] /remove-ImageGroup Group:<Image group name> [/Server:<Server name>]
Parameter | Description |
---|---|
imagegroup:<Image group name> | Specifies the name of the image group to be removed |
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
To remove the image group, type one of the following:
wdsutil /remove-ImageGroumediaGroup:ImageGroup1
wdsutil /verbose /remove-ImageGroumediaGroup:My Image Group /Server:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Removes a custom namespace.
wdsutil /remove-Namespace /Namespace:<Namespace name> [/Server:<Server name>] [/force]
Parameter | Description |
---|---|
/Namespace:<Namespace name> | Specifies the name of the namespace. This is not the friendly name, and it must be unique. - Deployment Server role service: The syntax for namespace name is /Namespace:WDS:<ImageGroup>/<ImageName>/<Index>. For example: WDS:ImageGroup1/install.wim/1 |
[/Server:<Server name>] | Specifies the name of the server. This can be the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server is used. |
[/force] | removes the namespace immediately and terminates all clients. Note that unless you specify /force, existing clients can complete the transfer, but new clients are not able to join. |
To stop a namespace (current clients can complete the transfer but new clients are not able to join), type:
wdsutil /remove-Namespace /Namespace:Custom Auto 1
To force termination of all clients, type:
wdsutil /remove-Namespace /Server:MyWDSServer /Namespace:Custom Auto 1 /force
Removes a driver package from a driver group on a server.
wdsutil /Remove-DriverGroupPackage /DriverGroup:<Group Name> [/Server:<Server Name>] {/DriverPackage:<Name> | /PackageId:<ID>}
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be the NetBIOS name or the FQDN. If a server name is not specified, the local server is used. |
[/DriverPackage:<Name>] | Specifies the name of the driver package to remove. |
[/PackageId:<ID>] | Specifies the Windows Deployment Services ID of the driver package to remove. You must specify this option if the driver package cannot be uniquely identified by name. |
wdsutil /Remove-DriverGroupPackage /DriverGroup:PrinterDrivers /PackageId:{4D36E972-E325-11CE-BFC1-08002BE10318}
wdsutil /Remove-DriverGroupPackage /DriverGroup:PrinterDrivers /DriverPackage:XYZ
Removes a filter rule from a driver group on a server.
wdsutil /Remove-DriverGroupFilter /DriverGroup:<Group Name> [/Server:<Server name>] /FilterType:<Filter Type>
Parameter | Description |
---|---|
/DriverGroup:<Group Name> | Specifies the name of the driver group. |
[/Server:<Server name>] | Specifies the name of the server. This can be the NetBIOS name or the FQDN. If a server name is not specified, the local server is used. |
[/FilterType:<FilterType>] | Specifies the type of the filter to remove from the group. <FilterType> can be one of the following:BiosVendorBiosVersionChassisTypeManufacturerUuidOsVersionOsEditionOsLanguage |
To remove a filter, type one of the following:
wdsutil /Remove-DriverGroupFilter /DriverGroup:PrinterDrivers /FilterType:Manufacturer
wdsutil /Remove-DriverGroupFilter /DriverGroup:PrinterDrivers /FilterType:Manufacturer /FilterType:OSLanguage
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Subommand | Description |
---|---|
wdsutil remove-image command | removes a boot or install image from the server. |
wdsutil remove-imagegroup command | removes an image group from the server. |
wdsutil remove-multicasttransmission command | Disables multicast transmission of an image. |
wdsutil remove-namespace command | removes a namespace from the server. |
wdsutil remove-drivergrouppackage command | removes a driver package from a driver group on a server. |
wdsutil remove-drivergrouppackages command | removes driver packages from a driver group on a server. |
wdsutil remove-driverpackage command | removes a driver package from a server. |
wdsutil remove-driverpackages command | removes driver packages from a server. |
wdsutil remove-drivergroup command | removes a driver group from a server. |
wdsutil remove-drivergroupfilter command | removes a filter rule from a driver group on a server. |
Creates a new discover image from an existing boot image. Discover images are boot images that force the Setup.exe program to start in Windows Deployment Services mode and then discover a Windows Deployment Services server. Typically these images are used to deploy images to computers that are not capable of booting to PXE. For more information, see Creating Images (https://go.microsoft.com/fwlink/?LinkId=115311).
wdsutil [Options] /New-DiscoverImage [/Server:<Server name>]
/Image:<Image name>
/Architecture:{x86 | ia64 | x64}
[/Filename:<File name>]
/DestinationImage
/FilePath:<File path and name>
[/Name:<Name>]
[/Description:<Description>]
[/WDSServer:<Server name>]
[/Overwrite:{Yes | No | Append}]
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
/Image:<Image name> | Specifies the name of the source boot image. |
/Architecture:{x86 | ia64 |
[/Filename:<File name>] | If the image cannot be uniquely identified by name, you must use this option to specify the file name. |
/DestinationImage | Specifies the settings for the destination image. You can specify the settings using the following options:- /FilePath:< File path and name> - Sets full file path for the new image.- [/Name:<Name>] - Sets the display name of the image. If no display name is specified, the display name of the source image will be used.- [/Description: <Description>] - Sets the description of the image.- [/WDSServer: <Server name>] - Specifies the name of the server that all clients who boot from the specified image should contact to download the install image. By default, all clients who boot this image will discover a valid Windows Deployment Services server. Using this option bypasses the discovery functionality and forces the booted client to contact the specified server.- [/Overwrite:{Yes |
To create a discover image out of boot image, and name it WinPEDiscover.wim, type:
wdsutil /New-DiscoverImage /Image:WinPE boot image /Architecture:x86 /DestinationImage /FilePath:C:\Temp\WinPEDiscover.wim
To create a discover image out of boot image, and name it WinPEDiscover.wim with the specified settings, type:
wdsutil /Verbose /Progress /New-DiscoverImage /Server:MyWDSServer
/Image:WinPE boot image /Architecture:x64 /Filename:boot.wim /DestinationImage /FilePath:\\Server\Share\WinPEDiscover.wim
/Name:New WinPE image /Description:WinPE image for WDS Client discovery /Overwrite:No
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Retrieves information about an image group and the images within it.
wdsutil [Options] /Get-ImageGroup ImageGroup:<Image group name> [/Server:<Server name>] [/detailed]
Parameter | Description |
---|---|
/ImageGroup:<Image group name> | Specifies the name of the image group. |
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
[/detailed] | Returns the image metadata for each image. If this parameter is not use, the default behavior is to return only the image name, description, and file name. |
To view information about an image group, type:
wdsutil /Get-ImageGroup ImageGroup:ImageGroup1
To view information including metadata, type:
wdsutil /verbose /Get-ImageGroup ImageGroup:ImageGroup1 /Server:MyWDSServer /detailed
Retrieves information about the images contained in a Windows Image (.wim) file.
wdsutil [Options] /Get-ImageFile /ImageFile:<wim file path> [/Detailed]
Parameter | Description |
---|---|
/ImageFile:<WIM file path> | Specifies the full path and file name of the .wim file. |
[/Detailed] | Returns all image metadata from each image. If this option is not used, the default behavior is to return only the image name, description, and file name. |
To view information about an image, type:
wdsutil /Get-ImageFile /ImageFile:C:\temp\install.wim
To view detailed information, type:
wdsutil /Verbose /Get-ImageFile /ImageFile:\\Server\Share\My Folder \install.wim /Detailed
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Retrieves information about an image.
For boot images:
wdsutil [Options] /Get-Image image:<Image name> [/Server:<Server name> imagetype:Boot /Architecture:{x86 | ia64 | x64} [/Filename:<File name>]
For install images:
wdsutil [Options] /Get-image image:<Image name> [/Server:<Server name> imagetype:Install imagegroup:<Image group name>] [/Filename:<File name>]
Parameter | Description |
---|---|
\image:<Image name> | Specifies the name of the image. |
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
imagetype:{Boot | Install} | Specifies the type of image. |
/Architecture:{x86 | ia64 | x64} | Specifies the architecture of the image. Because it is possible to have the same image name for boot images in different architectures, specifying the architecture value ensures that the correct image is returned. |
[/Filename:<File name>] | if the image cannot be uniquely identified by name, you must use this option to specify the file name. |
\imagegroup:<Image group name>] | Specifies the image group that contains the image. If no image group is specified and only one image group exists on the server, that group will be used. If more than one image group exists on the server, you must use this parameter to specify the image group. |
To retrieve information about a boot image, type one of the following:
wdsutil /Get-Image image:WinPE boot imagetype:Boot /Architecture:x86
wdsutil /verbose /Get-Image image:WinPE boot image /Server:MyWDSServer imagetype:Boot /Architecture:x86 /Filename:boot.wim
To retrieve information about an install image, type one of the following:
wdsutil /Get-Image:Windows Vista with Office imagetype:Install
wdsutil /verbose /Get-Image:Windows Vista with Office /Server:MyWDSServer imagetype:Install imagegroup:ImageGroup1 /Filename:install.wim
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Adds a driver group to the server.
wdsutil /add-DriverGroup /DriverGroup:<Groupname>\n\ [/Server:<Servername>] [/Enabled:{Yes | No}] [/Applicability:{Matched | All}] [/Filtertype:<Filtertype> /Policy:{Include | Exclude} /Value:<Value> [/Value:<Value> ...]]
Parameter | Description | |
---|---|---|
/DriverGroup:<Groupname> |
Specifies the name of the new driver group. | |
/Server:<Servername> |
Specifies the name of the server. This can be the NetBIOS name or the FQDN. If no server name is specified, the local server is used. | |
/Enabled:`{Yes | No}` | Enables or disables the package. |
/Applicability:`{Matched | All}` | Specifies which packages to install if the filter criteria are met. Matched means install only the driver packages that match a client s hardware. All means install all the packages to clients regardless of their hardware. |
/Filtertype:<Filtertype> |
Specifies the type of the filter to add to the group. You can specify multiple filter types in a single command. Each filter type must be followed by /Policy and at least one /Value. Valid values include:
|
|
[/Policy:`{Include | Exclude}`] | Specifies the policy to be set on the filter. If /Policy is set to Include, client computers that match the filter are allowed to install the drivers in this group. If /Policy is set to Exclude, then client computers that match the filter are not allowed to install the drivers in this group. |
[/Value:<Value> ] |
Specifies the client value that corresponds to /Filtertype. You can specify multiple values for a single type. For information about acceptable filter type values, see Driver Group Filters. |
To add a driver group, type either:
wdsutil /add-DriverGroup /DriverGroup:printerdrivers /Enabled:Yes
wdsutil /add-DriverGroup /DriverGroup:printerdrivers /Applicability:All /Filtertype:Manufacturer /Policy:Include /Value:Name1 /Filtertype:Chassistype /Policy:Exclude /Value:Tower /Value:MiniTower
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays information about the driver groups on a server.
wdsutil /Get-DriverGroup /DriverGroup:<Group Name> [/Server:<Server name>]
Parameter | Description |
---|---|
/DriverGroup:<Group Name> | Specifies the name of the driver group. |
[/Server:<Server name>] | Specifies the name of the server. This can be the NetBIOS name or the FQDN. if a server name is not specified, the local server is used. |
[/Show: {PackageMetaData | Filters | All}] | Displays the metadata for all the driver packages in the specified group. PackageMetaData displays information about all the filters for the driver group. Filters displays the metadata for all driver packages and filters for the group. |
To view information about a driver file, type:
wdsutil /Get-DriverGroup /DriverGroup:printerdrivers /Show:PackageMetaData
wdsutil /Get-DriverGroup /DriverGroup:printerdrivers /Server:MyWdsServer /Show:Filters
Retrieves information about all Windows Deployment Services servers.
[!NOTE] This command may take an extended amount of time to complete if there are many Windows Deployment Services servers in your environment or if the network connection linking the servers is slow.
wdsutil [Options] /Get-AllServers /Show:{Config | Images | All} [/Detailed] [/Forest:{Yes | No}]
Parameter | Description |
---|---|
/Show:{Config | Images |
[/Detailed] | When used in conjunction with the /Show:Images or /Show:All, returns all image metadata from each image. If the /Detailed option is not specified, the default behavior is to return the image name, description, and file name. |
[/Forest:{Yes | No}] |
To view information about all servers, type:
wdsutil /Get-AllServers /Show:Config
To view detailed information about all servers, type:
wdsutil /Verbose /Get-AllServers /Show:All /Detailed /Forest:Yes
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Configures the computer's Trusted Platform Module (TPM).
manage-bde -tpm [-turnon] [-takeownership <ownerpassword>] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
-turnon | Enables and activates the TPM, allowing the TPM owner password to be set. You can also use -t as an abbreviated version of this command. |
-takeownership | Takes ownership of the TPM by setting an owner password. You can also use -o as an abbreviated version of this command. |
<ownerpassword> |
Represents the owner password that you specify for the TPM. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To turn on the TPM, type:
manage-bde tpm -turnon
To take ownership of the TPM and set the owner password to 0wnerP@ss, type:
manage-bde tpm takeownership 0wnerP@ss
Resumes BitLocker encryption or decryption after it has been paused.
manage-bde -resume [<drive>] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<drive> |
Represents a drive letter followed by a colon. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To resume BitLocker encryption on drive C, type:
manage-bde –resume C:
Pauses BitLocker encryption or decryption.
manage-bde -pause [<volume>] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<volume> |
Specifies a drive letter followed by a colon, a volume GUID path, or a mounted volume. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To pause BitLocker encryption on drive C, type:
manage-bde -pause C:
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016
The Network Shell command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a currently running computer. You can start this utility at the command prompt or in Windows PowerShell.
netsh [-a <Aliasfile>][-c <Context>][-r <Remotecomputer>][-u [<domainname>\<username>][-p <Password> | [{<NetshCommand> | -f <scriptfile>}]
Parameter | Description |
---|---|
-a <Aliasfile> |
Specifies that you are returned to the netsh prompt after running Aliasfile and the name of the text file that contains one or more netsh commands. |
-c <Context> |
Specifies that netsh enters the specified netsh context and the netsh context to enter. |
-r <Remotecomputer> |
Specifies the remote computer to configure. Important: If you use this parameter, you must make sure the Remote Registry service is running on the remote computer. If it isn't running, Windows displays a “Network Path Not Found” error message. |
-u <domainname>\<username> |
Specifies the domain and user account name to use while running the netsh command under a user account. If you omit the domain, the local domain is used by default. |
-p <Password> |
Specifies the password for the user account specified by the -u <username> parameter. |
<NetshCommand> |
Specifies the netsh command to run. |
-f <scriptfile> |
Exits the netsh command after running the specified script file. |
/? | Displays help at the command prompt. |
If you specify -r followed by another command, netsh runs the command on the remote computer and then returns to the Cmd.exe command prompt. If you specify -r without another command, netsh opens in remote mode. The process is similar to using set machine at the Netsh command prompt. When you use -r, you set the target computer for the current instance of netsh only. After you exit and reenter netsh, the target computer is reset as the local computer. You can run netsh commands on a remote computer by specifying a computer name stored in WINS, a UNC name, an Internet name to be resolved by the DNS server, or an IP address.
If your string value contains spaces between characters, you must enclose the string value in quotation marks. For example, -r "contoso remote device"
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Disables all services for Windows Deployment Services.
Parameter | Description |
---|---|
wdsutil disable-server command | Disables all Windows Deployment Services services on a specified server (Deployment Server). |
wdsutil disable-transportserver command | Disables all Windows Deployment Services services on a specified Transport Server. |
Wipes the free space on the volume, removing any data fragments that may have existed in the space. Running this command on a volume encrypted using the Used Space Only encryption method provides the same level of protection as the Full Volume Encryption encryption method.
manage-bde -wipefreespace|-w [<drive>] [-cancel] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<drive> |
Represents a drive letter followed by a colon. |
-cancel | Cancels a wipe of free space that is in process. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To wipe the free space on drive C, type either:
manage-bde -w C:
manage-bde -wipefreespace C:
To cancel the wipe of tje free space on drive C, type either:
manage-bde -w -cancel C:
manage-bde -wipefreespace -cancel C:
Disables all services for a Windows Deployment Services server.
wdsutil [Options] /Disable-Server [/Server:<Server name>]
Parameter | Description |
---|---|
[/Server:<Servername> ] |
Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
To disable the server, type either:
wdsutil /Disable-Server
wdsutil /Verbose /Disable-Server /Server:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Disables all services for a Transport Server.
wdsutil [Options] /Disable-TransportServer [/Server:<Servername>]
Parameter | Description |
---|---|
[/Server:<Servername> ] |
Specifies the name of the Transport Server to be disabled. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no Transport Server name is specified, the local server will be used. |
To disable the server, type either:
wdsutil /Disable-TransportServer
wdsutil /verbose /Disable-TransportServer /Server:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Deletes computers that are pending, rejected, or approved from the auto-add database. This database stores information about these computers on the server.
wdsutil /delete-AutoaddDevices [/Server:<Servername>] /Devicetype:{PendingDevices | RejectedDevices |ApprovedDevices}
Parameter | Description | ||
---|---|---|---|
[/Server:<Servername> ] |
Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. | ||
/Devicetype:`{PendingDevices | RejectedDevices | ApprovedDevices}` | Specifies the type of computer to delete from the database. This type can be PendingDevices, which returns all computers in the database that have a status of pending, RejectedDevices, which returns all computers in the database that have a status of rejected, or ApprovedDevices, which returns all computers that have a status of approved. |
To delete all rejected computers, type:
wdsutil /delete-AutoaddDevices /Devicetype:RejectedDevices
To delete all approved computers, type:
wdsutil /verbose /delete-AutoaddDevices /Server:MyWDSServer /Devicetype:ApprovedDevices
Cancels the backup or recovery operation that is currently running.
[!IMPORTANT] Canceled operations can't be restarted. You must run a canceled backup or a recovery operation from the beginning again.
To stop a backup or recovery operation using this command, you must be a member of the Backup Operators group or the Administrators group, or you must have been delegated the appropriate permissions. In addition, you must run wbadmin from an elevated command prompt, by right-clicking Command Prompt, and then selecting Run as administrator.
wbadmin stop job [-quiet]
Parameter | Description |
---|---|
-quiet | Runs the command without prompts to the user. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Manages File Server for Macintosh servers, volumes, directories, and files. You can automate administrative tasks by including a series of commands in batch files and starting them manually or at predetermined times.
To change the directory name, location, owner, group, and permissions for Macintosh-accessible volumes.
macfile directory[/server:\\<computername>] /path:<directory> [/owner:<ownername>] [/group:<groupname>] [/permissions:<permissions>]
Parameter | Description |
---|---|
/server:\\<computername> |
Specifies the server on which to change a directory. If omitted, the operation is performed on the local computer. |
/path:<directory> |
Specifies the path to the directory that you want to change. This parameter is required. Note: The directory must exist, using macfile directory won't create directories. |
/owner:<ownername> |
Changes the owner of the directory. If omitted, the owner name won't change. |
/group:<groupname> |
Specifies or changes the Macintosh primary group that is associated with the directory. If omitted, the primary group remains unchanged. |
/permissions:<permissions> |
Sets permissions on the directory for the owner, primary group, and world (everyone). This must be an 11-digit number, where the number 1 grants permission and 0 revokes permission (for example, 11111011000). If this parameter is omitted, permissions remain unchanged. |
/? | Displays help at the command prompt. |
The position of the permissions digit determines which permission is set, including:
Position | Sets Permission |
---|---|
First | OwnerSeeFiles |
Second | OwnerSeeFolders |
Third | OwnerMakechanges |
Fourth | GroupSeeFiles |
Fifth | GroupSeeFolders |
Sixth | GroupMakechanges |
Seventh | WorldSeeFiles |
Eighth | WorldSeeFolders |
Ninth | WorldMakechanges |
Tenth | The directory can't be renamed, moved, or deleted. |
Eleventh | The changes apply to the current directory and all subdirectories. |
If the information that you supply contains spaces or special characters, use quotation marks around the text (for example, "<computer name>
").
Use macfile directory to make an existing directory in a Macintosh-accessible volume available to Macintosh users. The macfile directory command doesn't create directories.
Use File Manager, the command prompt, or the macintosh new folder command to create a directory in a Macintosh-accessible volume before you use the macfile directory command.
To assign See Files, See Folders, and Make changes permissions to the owner, to set See Folder permissions to all other users, and to prevent the directory from being renamed, moved, or deleted, type:
macfile directory /path:e:\statistics\may sales /permissions:11111011000
Where the subdirectory is May sales, located in the Macintosh-accessible volume Statistics, on the E: drive of the local server.
To specify the server on which to join files, who created the file, the type of file, where the data fork is located, where the resource fork is located, and where the output file should be located.
macfile forkize[/server:\\<computername>] [/creator:<creatorname>] [/type:<typename>] [/datafork:<filepath>] [/resourcefork:<filepath>] /targetfile:<filepath>
Parameter | Description |
---|---|
/server:\\<computername> |
Specifies the server on which to join files. If omitted, the operation is performed on the local computer. |
/creator:<creatorname> |
Specifies the creator of the file. The Macintosh finder uses the /creator command-line option to determine the application that created the file. |
/type:<typename> |
Specifies the type of file. The Macintosh finder uses the /type command-line option to determine the file type within the application that created the file. |
/datafork:<filepath> |
Specifies the location of the data fork that is to be joined. You can specify a remote path. |
/resourcefork:<filepath> |
Specifies the location of the resource fork that is to be joined. You can specify a remote path. |
/targetfile:<filepath> |
Specifies the location of the file that's created by joining a data fork and a resource fork, or specifies the location of the file whose type or creator you are changing. The file must be on the specified server. This parameter is required. |
/? | Displays help at the command prompt. |
<computer name>
").To create the file tree_app on the Macintosh-accessible volume D:\Release, using the resource fork C:\Cross\Mac\Appcode, and to make this new file appear to Macintosh clients as an application (Macintosh applications use the type APPL) with the creator (signature) set to MAGNOLIA, type:
macfile forkize /resourcefork:c:\cross\mac\appcode /type:APPL /creator:MAGNOLIA /targetfile:D:\Release\tree_app
To change the file creator to Microsoft Word 5.1, for the file Word.txt in the directory D:\Word documents\Group files, on the server \ServerA, type:
macfile forkize /server:\\ServerA /creator:MSWD /type:TEXT /targetfile:d:\Word documents\Group files\Word.txt
To change the sign on message that appears when a user signs in to the File Server for Macintosh server and to limit the number of users who can simultaneously use File and print Servers for Macintosh.
macfile server [/server:\\<computername>] [/maxsessions:{number | unlimited}] [/loginmessage:<message>]
Parameter | Description | |
---|---|---|
/server:\\<computername> |
Specifies the server on which to change parameters. If omitted, the operation is performed on the local computer. | |
/maxsessions:`{number | unlimited}` | Specifies the maximum number of users who can simultaneously use File and print Servers for Macintosh. If omitted, the maxsessions setting for the server remains unchanged. |
/loginmessage:<message> |
Changes the message Macintosh users see when signing in to the File Server for Macintosh server. The maximum number of characters for the sign-in message is 199. If omitted, the loginmessage message for the server remains unchanged. To remove an existing sign-in message, include the /loginmessage parameter, but leave the message variable blank. | |
/? | Displays help at the command prompt. |
<computer name>
").To change the number of permitted File and print Server for Macintosh sessions on the local server to five sessions, and to add the sign-in message "Sign off from Server for Macintosh when you are finished", type:
macfile server /maxsessions:5 /loginmessage:Sign off from Server for Macintosh when you are finished
To add, change, or remove a Macintosh-accessible volume.
macfile volume {/add|/set} [/server:\\<computername>] /name:<volumename>/path:<directory>[/readonly:{true | false}] [/guestsallowed:{true | false}] [/password:<password>] [/maxusers:{<number>>|unlimited}]
macfile volume /remove[/server:\\<computername>] /name:<volumename>
Parameter | Description | |
---|---|---|
`{/add | /set}` | Required when adding or changing a Macintosh-accessible volume. Adds or changes the specified volume. |
/server:\\<computername> |
Specifies the server on which to add, change, or remove a volume. If omitted, the operation is performed on the local computer. | |
/name:<volumename> |
Required. Specifies the volume name to be added, changed, or removed. | |
/path:<directory> |
Required and valid only when you are adding a volume. Specifies the path to the root directory of the volume to be added. | |
/readonly:`{true | false}` | Specifies whether users can change files in the volume. Use True to specify that users can't change files in the volume. Use False to specify that users can change files in the volume. If omitted when adding a volume, changes to files are allowed. If omitted when changing a volume, the readonly setting for the volume remains unchanged. |
/guestsallowed:`{true | false}` | Specifies whether users who log on as guests can use the volume. Use True to specify that guests can use the volume. Use False to specify that guests can't use the volume. If omitted when adding a volume, guests can use the volume. If omitted when changing a volume, the guestsallowed setting for the volume remains unchanged. |
/password:<password> |
Specifies a password that will be required to access the volume. If omitted when adding a volume, no password is created. If omitted when changing a volume, the password remains unchanged. | |
/maxusers:`{ |
unlimited}` | Specifies the maximum number of users who can simultaneously use the files on the volume. If omitted when adding a volume, an unlimited number of users can use the volume. If omitted when changing a volume, the maxusers value remains unchanged. |
/remove | Required when you are removing a Macintosh-accessible volume. removes the specified volume. | |
/? | Displays help at the command prompt. |
<computer name>
").To create a volume called US Marketing Statistics on the local server, using the Stats directory in the E drive, and to specify that the volume cannot be accessed by guests, type:
macfile volume /add /name:US Marketing Statistics /guestsallowed:false /path:e:\Stats
To change the volume created above to be read-only, to require a password, and to set the number of maximum users to five, type:
macfile volume /set /name:US Marketing Statistics /readonly:true /password:saturn /maxusers:5
To add a volume called Landscape Design, on the server \Magnolia, using the trees directory in the E drive, and to specify that the volume can be accessed by guests, type:
macfile volume /add /server:\\Magnolia /name:Landscape Design /path:e:\trees
To remove the volume called Sales Reports on the local server, type:
macfile volume /remove /name:Sales Reports
Message Queuing technology enables apps running at different times to communicate across heterogeneous networks and systems that may be temporarily offline. Message Queuing provides guaranteed message delivery, efficient routing, security, and priority-based messaging. It can be used to implement solutions for both asynchronous and synchronous messaging scenarios. For more information about Message Queuing, see Message Queuing (MSMQ).
mqsvc.exe
Updates an existing data collector.
logman update <counter | trace | alert | cfg | api> <[-n] <name>> [options]
Parameter | Description |
---|---|
logman update counter | Updates a counter data collector. |
logman update alert | Updates an alert data collector. |
logman update cfg | Updates a configuration data collector. |
logman update api | Updates an API tracing data collector. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays the status of a print queue on a computer running Line printer Daemon (LPD).
lpq -S <servername> -P <printername> [-l]
Parameter | Description |
---|---|
-S <servername> |
Specifies (by name or IP address) the computer or printer sharing device that hosts the LPD print queue with a status that you want to display. This parameter is required and must be capitalized. |
-P <Printername> |
Specifies (by name) the printer for the print queue with a status that you want to display. This parameter is required and must be capitalized. |
-l | Specifies that you want to display details about the status of the print queue. |
/? | Displays help at the command prompt. |
To display the status of the Laserprinter1 printer queue on an LPD host at 10.0.0.45, type:
lpq -S 10.0.0.45 -P Laserprinter1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Deletes an existing data collector.
logman delete <[-n] <name>> [options]
Parameter | Description |
---|---|
-s <computer name> |
Performs the command on the specified remote computer. |
-config <value> |
Specifies the settings file containing command options. |
[-n] <name> |
Name of the target object. |
-ets | Sends commands to Event Trace Sessions directly without saving or scheduling. |
-[-]u <user [password]> |
Specifies the user to Run As. Entering a * for the password produces a prompt for the password. The password is not displayed when you type it at the password prompt. |
/? | Displays context-sensitive help. |
To delete the data collector perf_log, type:
logman delete perf_log
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Approves computers that are pending administrative approval. When the Auto-add policy is enabled, administrative approval is required before unknown computers (those that are not pre-staged) can install an image. You can enable this policy using the PXE Response tab of the server s properties page.
wdsutil [Options] /Approve-AutoaddDevices [/Server:<Server name>] /RequestId:{<Request ID>| ALL} [/MachineName:<Device name>] [/OU:<DN of OU>] [/User:<Domain\User | User@Domain>] [/JoinRights:{JoinOnly | Full}] [/JoinDomain:{Yes | No}] [/ReferralServer:<Server name>] [/BootProgram:<Relative path>] [/WdsClientUnattend:<Relative path>] [/BootImagepath:<Relative path>]
Parameter | Description | |
---|---|---|
/Server:<Servername> |
Specifies the name of the server. This can be the NetBIOS name or the FQDN. If no server name is specified, the local server is used. | |
/RequestId:`{Request ID | ALL}` | Specifies the request ID assigned to the pending computer. Specify ALL to approve all pending computers. |
/Machinename:<Devicename> |
Specifies the name of the device to be added. You can't use this option when approving all computers. | |
[/OU:<DN of OU> ] |
The distinguished name of the organizational unit where the computer account object should be created. For example: OU=MyOU,CN=Test, DC=Domain,DC=com. The default location is the default computer's container. | |
[/User:`<Domain\User | User@Domain>`] | Sets permissions on the computer account object to give the specified user the necessary rights to join the computer to the domain. |
[/JoinRights:`{JoinOnly | Full}`] | Specifies the type of rights to be assigned to the user.
|
[/JoinDomain:`{Yes | No}`] | Specifies whether the computer should be joined to the domain as this computer account during operating system installation. The default value is Yes. |
[/ReferralServer:<Servername> ] |
Specifies the name of the server to contact to download the network boot program and boot image by using Trivial File Transfer Protocol (tftp). | |
[/BootProgram:<Relativepath> ] |
Specifies the relative path from the remoteInstall folder to the network boot program that this computer should receive. For example: boot\x86\pxeboot.com. | |
[/WdsClientUnattend:<Relativepath> ] |
Specifies the relative path from the remoteInstall folder to the unattend file that automates the Windows Deployment Services client. | |
[/BootImagepath:<Relativepath> ] |
Specifies the relative path from the remoteInstall folder to the boot image that this computer should receive. |
To approve the computer with a RequestId of 12, type:
wdsutil /Approve-AutoaddDevices /RequestId:12
To approve the computer with a RequestID of 20 and to deploy the image with the specified settings, type:
wdsutil /Approve-AutoaddDevices /RequestId:20 /MachineName:computer1 /OU:OU=Test,CN=company,DC=Domain,DC=Com /User:Domain\User1
/JoinRights:Full /ReferralServer:MyWDSServer /BootProgram:boot\x86\pxeboot.n12 /WdsClientUnattend:WDSClientUnattend\Unattend.xml /BootImagepath:boot\x86\images\boot.wim
To approve all pending computers, type:
wdsutil /verbose /Approve-AutoaddDevices /RequestId:ALL
Unlocks a BitLocker-protected drive by using a recovery password or a recovery key.
manage-bde -unlock {-recoverypassword <password>|-recoverykey <pathtoexternalkeyfile>} <drive> [-certificate {-cf pathtocertificatefile | -ct certificatethumbprint} {-pin}] [-password] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
-recoverypassword | Specifies that a recovery password will be used to unlock the drive. You can also use -rp as an abbreviated version of this command. |
<password> |
Represents the recovery password that can be used to unlock the drive. |
-recoverykey | Specifies that an external recovery key file will be used to unlock the drive. You can also use -rk as an abbreviated version of this command. |
<pathtoexternalkeyfile> |
Represents the external recovery key file that can be used to unlock the drive. |
<drive> |
Represents a drive letter followed by a colon. |
-certificate | The local user certificate for a BitLocker certificate to unlock the volume is located in the local user certificate store. You can also use -cert as an abbreviated version of this command. |
-cf <pathtocertificatefile> |
Path to the certificate file. |
-ct <certificatethumbprint> |
Certificate thumbprint which may optionally include the PIN (-pin). |
-password | Presents a prompt for the password to unlock the volume. You can also use -pw as an abbreviated version of this command. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To unlock drive E with a recovery key file that's been saved to a backup folder on another drive, type:
manage-bde –unlock E: -recoverykey F:\Backupkeys\recoverykey.bek
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Logs off a user from a session on a Remote Desktop Session Host server and deletes the session.
logoff [<sessionname> | <sessionID>] [/server:<servername>] [/v]
Parameter | Description |
---|---|
<sessionname> |
Specifies the name of the session. This must be an active session. |
<sessionID> |
Specifies the numeric ID which identifies the session to the server. |
/server:<servername> |
Specifies the Remote Desktop Session Host server that contains the session whose user you want to log off. If unspecified, the server on which you are currently active is used. |
/v | Displays information about the actions being performed. |
/? | Displays help at the command prompt. |
You can always log off yourself from the session to which you are currently logged on. You must, however, have Full Control permission to log off users from other sessions.
Logging off a user from a session without warning can result in loss of data at the user's session. You should send a message to the user by using the msg command to warn the user before taking this action.
If <sessionID>
or <sessionname>
isn't specified, logoff logs the user off from the current session.
After you log off a user, all processes end and the session is deleted from the server.
You can't log off a user from the console session.
To log off a user from the current session, type:
logoff
To log off a user from a session by using the session's ID, for example session 12, type:
logoff 12
To log off a user from a session by using the name of the session and server, for example session TERM04 on Server1, type:
logoff TERM04 /server:Server1
Provides the means to install, modify, and perform operations on Windows Installer from the command line.
Set the install type for launching an installation package.
msiexec.exe [/i][/a][/j{u|m|/g|/t}][/x] <path_to_package>
Parameter | Description |
---|---|
/i | Specifies normal installation. |
/a | Specifies administrative installation. |
/ju | Advertise the product to the current user. |
/jm | Advertise the product to all users. |
/j/g | Specifies the language identifier used by the advertised package. |
/j/t | Applies transform to the advertised package. |
/x | Uninstalls the package. |
<path_to_package> |
Specifies the location and name of the installation package file. |
To install a package named example.msi from the C: drive, using a normal installation process, type:
msiexec.exe /i "C:\example.msi"
You can configure what a user sees during the installation process, based on your target environment. For example, if you're distributing a package to all clients for manual installation, there should be a full UI. However, if you're deploying a package using Group Policy, which requires no user interaction, there should be no UI involved.
msiexec.exe /i <path_to_package> [/quiet][/passive][/q{n|b|r|f}]
Parameter | Description |
---|---|
<path_to_package> |
Specifies the location and name of the installation package file. |
/quiet | Specifies quiet mode, which means there's no user interaction required. |
/passive | Specifies unattended mode, which means the installation only shows a progress bar. |
/qn | Specifies there's no UI during the installation process. |
/qn+ | Specifies there's no UI during the installation process, except for a final dialog box at the end. |
/qb | Specifies there's a basic UI during the installation process. |
/qb+ | Specifies there's a basic UI during the installation process, including a final dialog box at the end. |
/qr | Specifies a reduced UI experience during the installation process. |
/qf | Specifies a full UI experience during the installation process. |
To install package C:\example.msi, using a normal installation process and no UI, type:
msiexec.exe /i "C:\example.msi" /qn
If your installation package overwrites files or attempts to change files that are in use, a reboot might be required before the installation completes.
msiexec.exe /i <path_to_package> [/norestart][/promptrestart][/forcerestart]
Parameter | Description |
---|---|
<path_to_package> |
Specifies the location and name of the installation package file. |
/norestart | Stops the device from restarting after the installation completes. |
/promptrestart | Prompts the user if a reboot is required. |
/forcerestart | Restarts the device after the installation completes. |
To install package C:\example.msi, using a normal installation process with no reboot at the end, type:
msiexec.exe /i "C:\example.msi" /norestart
If you need to debug your installation package, you can set the parameters to create a log file with specific information.
msiexec.exe [/i][/x] <path_to_package> [/L{i|w|e|a|r|u|c|m|o|p|v|x+|!|*}] <path_to_log>
Parameter | Description |
---|---|
/i | Specifies normal installation. |
/x | Uninstalls the package. |
<path_to_package> |
Specifies the location and name of the installation package file. |
/li | Turns on logging and includes status messages in the output log file. |
/lw | Turns on logging and includes non-fatal warnings in the output log file. |
/le | Turns on logging and includes all error messages in the output log file. |
/la | Turns on logging and includes information about when an action started in the output log file. |
/lr | Turns on logging and includes action-specific records in the output log file. |
/lu | Turns on logging and includes user request information in the output log file. |
/lc | Turns on logging and includes the initial UI parameters in the output log file. |
/lm | Turns on logging and includes out-of-memory or fatal exit information in the output log file. |
/lo | Turns on logging and includes out-of-disk-space messages in the output log file. |
/lp | Turns on logging and includes terminal properties in the output log file. |
/lp | Turns on logging and includes terminal properties in the output log file. |
/lv | Turns on logging and includes verbose output in the output log file. |
/lp | Turns on logging and includes terminal properties in the output log file. |
/lx | Turns on logging and includes extra debugging information in the output log file. |
/l+ | Turns on logging and appends the information to an existing log file. |
/l! | Turns on logging and flushes each line to the log file. |
/l* | Turns on logging and logs all information, except verbose information (/lv) or extra debugging information (/lx). |
<path_to_logfile> |
Specifies the location and name for the output log file. |
To install package C:\example.msi, using a normal installation process with all logging information provided, including verbose output, and storing the output log file at C:\package.log, type:
msiexec.exe /i "C:\example.msi" /L*V "C:\package.log"
You can apply or remove updates using an installation package.
msiexec.exe [/p][/update][/uninstall[/package<product_code_of_package>]] <path_to_package>
Parameter | Description |
---|---|
/p | Installs a patch. If you're installing silently, you must also set the REINSTALLMODE property to ecmus and REINSTALL to ALL. Otherwise, the patch only updates the MSI cached on the target device. |
/update | Install patches option. If you're applying multiple updates, you must separate them using a semi-colon (;). |
/package | Installs or configures a product. |
msiexec.exe /p "C:\MyPatch.msp"
msiexec.exe /p "C:\MyPatch.msp" /qb REINSTALLMODE="ecmus" REINSTALL="ALL"
msiexec.exe /update "C:\MyPatch.msp"
msiexec.exe /uninstall {1BCBF52C-CD1B-454D-AEF7-852F73967318} /package {AAD3D77A-7476-469F-ADF4-04424124E91D}
Where the first GUID is the patch GUID, and the second one is the MSI product code to which the patch was applied.
You can use this command to repair an installed package.
msiexec.exe [/f{p|o|e|d|c|a|u|m|s|v}] <product_code>
Parameter | Description |
---|---|
/fp | Repairs the package if a file is missing. |
/fo | Repairs the package if a file is missing, or if an older version is installed. |
/fe | Repairs the package if file is missing, or if an equal or older version is installed. |
/fd | Repairs the package if file is missing, or if a different version is installed. |
/fc | Repairs the package if file is missing, or if checksum does not match the calculated value. |
/fa | Forces all files to be reinstalled. |
/fu | Repairs all the required user-specific registry entries. |
/fm | Repairs all the required computer-specific registry entries. |
/fs | Repairs all existing shortcuts. |
/fv | Runs from source and re-caches the local package. |
To force all files to be reinstalled based on the MSI product code to be repaired, {AAD3D77A-7476-469F-ADF4-04424124E91D}, type:
msiexec.exe /fa {AAD3D77A-7476-469F-ADF4-04424124E91D}
You can set public properties through this command. For information about the available properties and how to set them, see Public Properties.
Adds a filter to a driver group on a server.
wdsutil /Add-DriverGroupFilter /DriverGroup:<Group Name> [/Server:<Server name>] /FilterType:<Filter Type> /Policy:{Include | Exclude} /Value:<Value> [/Value:<Value> ...]
Parameter | Description | |
---|---|---|
/DriverGroup:<Groupname> |
Specifies the name of the new driver group. | |
/Server:<Servername> |
Specifies the name of the server. This can be the NetBIOS name or the FQDN. If no server name is specified, the local server is used. | |
/Filtertype:<Filtertype> |
Specifies the type of the filter to add to the group. You can specify multiple filter types in a single command. Each filter type must be followed by /Policy and at least one /Value. Valid values include:
|
|
[/Policy:`{Include | Exclude}`] | Specifies the policy to be set on the filter. If /Policy is set to Include, client computers that match the filter are allowed to install the drivers in this group. If /Policy is set to Exclude, then client computers that match the filter are not allowed to install the drivers in this group. |
[/Value:<Value> ] |
Specifies the client value that corresponds to /Filtertype. You can specify multiple values for a single type. For information about acceptable filter type values, see Driver Group Filters. |
To add a filter to a driver group, type either:
wdsutil /Add-DriverGroupFilter /DriverGroup:PrinterDrivers /FilterType:Manufacturer /Policy:Include /Value:Name1 /Value:Name2
wdsutil /Add-DriverGroupFilter /DriverGroup:PrinterDrivers /FilterType:Manufacturer /Policy:Include /Value:Name1 /FilterType:ChassisType /Policy:Exclude /Value:Tower /Value:MiniTower
Modifies the PIN for an operating system drive. The user is prompted to enter a new PIN.
manage-bde -changepin [<drive>] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<drive> |
Represents a drive letter followed by a colon. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To change the PIN used with BitLocker on drive C, type:
manage-bde –changepin C:
Creates a directory or subdirectory. Command extensions, which are enabled by default, allow you to use a single md command to create intermediate directories in a specified path.
[!NOTE] This command is the same as the mkdir command.
md [<drive>:]<path>
Parameter | Description |
---|---|
<drive> : |
Specifies the drive on which you want to create the new directory. |
<path> |
Specifies the name and location of the new directory. The maximum length of any single path is determined by the file system. This is a required parameter. |
/? | Displays help at the command prompt. |
To create a directory named Directory1 within the current directory, type:
md Directory1
To create the directory tree Taxes\Property\Current within the root directory, with command extensions enabled, type:
md \Taxes\Property\Current
To create the directory tree Taxes\Property\Current within the root directory as in the previous example, but with command extensions disabled, type the following sequence of commands:
md \Taxes
md \Taxes\Property
md \Taxes\Property\Current
Upgrades the BitLocker version.
manage-bde -upgrade [<drive>] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<drive> |
Represents a drive letter followed by a colon. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To upgrade BitLocker encryption on drive C, type:
manage-bde –upgrade C:
Sets the drive identifier field on the drive to the value specified in the Provide the unique identifiers for your organization Group Policy setting.
manage-bde –setidentifier <drive> [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<drive> |
Represents a drive letter followed by a colon. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To set BitLocker drive identifier field for C, type:
manage-bde –setidentifier C:
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Merges a differencing virtual hard disk (VHD) with its corresponding parent VHD. The parent VHD will be modified to include the modifications from the differencing VHD. This command modifies the parent VHD. As a result, other differencing VHDs that are dependent on the parent will no longer be valid.
[!IMPORTANT] You must choose and detach a VHD for this operation to succeed. Use the select vdisk command to select a VHD and shift the focus to it.
merge vdisk depth=<n>
Parameter | Description |
---|---|
depth=<n> |
Indicates the number of parent VHD files to merge together. For example, depth=1 indicates that the differencing VHD will be merged with one level of the differencing chain. |
To merge a differencing VHD with its parent VHD, type:
merge vdisk depth=1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Package existing files into a cabinet (.cab) file.
[!NOTE] This command is the same as the diantz command.
makecab [/v[n]] [/d var=<value> ...] [/l <dir>] <source> [<destination>]
makecab [/v[<n>]] [/d var=<value> ...] /f <directives_file> [...]
Parameter | Description |
---|---|
<source> |
File to compress. |
<destination> |
File name to give compressed file. If omitted, the last character of the source file name is replaced with an underscore (_) and used as the destination. |
/f <directives_file> |
A file with makecab directives (may be repeated). |
/d var=<value> |
Defines variable with specified value. |
/l <dir> |
Location to place destination (default is current directory). |
/v[<n> ] |
Set debugging verbosity level (0=none,...,3=full). |
/? | Displays help at the command prompt. |
Forces a BitLocker-protected drive into recovery mode on restart. This command deletes all Trusted Platform Module (TPM)-related key protectors from the drive. When the computer restarts, only a recovery password or recovery key can be used to unlock the drive.
manage-bde –forcerecovery <drive> [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<drive> |
Represents a drive letter followed by a colon. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To cause BitLocker to start in recovery mode on drive C, type:
manage-bde –forcerecovery C:
Removes hardware shadow copies that were imported by using the import command.
mask <shadowsetID>
Parameter | Description |
---|---|
shadowsetID | Removes shadow copies that belong to the specified Shadow Copy Set ID. |
To remove the imported shadow copy %Import_1%, type:
mask %Import_1%
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Using mmc command-line options, you can open a specific mmc console, open mmc in author mode, or specify that the 32-bit or 64-bit version of mmc is opened.
mmc <path>\<filename>.msc [/a] [/64] [/32]
Parameter | Description |
---|---|
<path>\<filename>.msc |
starts mmc and opens a saved console. You need to specify the complete path and file name for the saved console file. If you do not specify a console file, mmc opens a new console. |
/a | Opens a saved console in author mode. Used to make changes to saved consoles. |
/64 | Opens the 64-bit version of mmc (mmc64). Use this option only if you are running a Microsoft 64-bit operating system and want to use a 64-bit snap-in. |
/32 | Opens the 32-bit version of mmc (mmc32). When running a Microsoft 64-bit operating system, you can run 32-bit snap-ins by opening mmc with this command-line option when you have 32-bit only snap-ins. |
You can use environment variables to create command lines or shortcuts that don't depend on the explicit location of console files. For instance, if the path to a console file is in the system folder (for example, mmc c:\winnt\system32\console_name.msc), you can use the expandable data string %systemroot% to specify the location (mmc%systemroot%\system32\console_name.msc). This may be useful if you're delegating tasks to people in your organization who are working on different computers.
When consoles are opened using the /a option, they're opened in author mode, regardless of their default mode. This doesn't permanently change the default mode setting for files; when you omit this option, mmc opens console files according to their default mode settings.
After you open mmc or a console file in author mode, you can open any existing console by clicking Open on the Console menu.
You can use the command line to create shortcuts for opening mmc and saved consoles. A command-line command works with the Run command on the Start menu, in any command-prompt window, in shortcuts, or in any batch file or program that calls the command.
Generates a key package for a drive. The key package can be used in conjunction with the repair tool to repair corrupted drives.
manage-bde -keypackage [<drive>] [-ID <keyprotectoryID>] [-path <pathtoexternalkeydirectory>] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<drive> |
Represents a drive letter followed by a colon. |
-ID | Creates a key package using the key protector with the identifier specified by this ID value. Tip: Use the manage-bde –protectors –get command, along with the drive letter that you want to create a key package for, to get a list of available GUIDs to use as the ID value. |
-path | Specifies the location to save the created key package. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To create a key package for drive C, based on the key protector identified by the GUID, and to save the key package to F:\Folder, type:
manage-bde -keypackage C: -id {84E151C1...7A62067A512} -path f:\Folder
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a counter, trace, configuration data collector, or API.
logman create <counter | trace | alert | cfg | api> <[-n] <name>> [options]
Parameter | Description |
---|---|
logman create counter | Creates a counter data collector. |
logman create trace | Creates a trace data collector. |
logman create alert | Creates an alert data collector. |
logman create cfg | Creates a configuration data collector. |
logman create api | Creates an API tracing data collector. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates and manages Event Trace Session and Performance logs and supports many functions of Performance Monitor from the command line.
logman [create | query | start | stop | delete| update | import | export | /?] [options]
Parameter | Description |
---|---|
logman create | Creates a counter, trace, configuration data collector, or API. |
logman query | Queries data collector properties. |
logman start | stop | Starts or stops data collection. |
logman delete | Deletes an existing data collector. |
logman update | Updates the properties of an existing data collector. |
logman import | export | Imports a data collector set from an XML file or export a data collector set to an XML file. |
Lists writers that are on the system. If used without parameters, list displays the output for list metadata by default.
list writers [metadata | detailed | status]
Parameter | Description |
---|---|
metadata | Lists the identity and status of writers, and displays metadata such as component details and excluded files. This is the default parameter. |
detailed | Lists the same information as metadata, but also includes the full file list for all components. |
status | Lists only the identity and status of registered writers. |
To list only the identity and status of writers, type:
list writers status
Output that is similar to the following displays:
Listing writer status ...
* WRITER System Writer
- Status: 5 (VSS_WS_WAITING_FOR_BACKUP_COMPLETE)
- Writer Failure code: 0x00000000 (S_OK)
- Writer ID: {e8132975-6f93-4464-a53e-1050253ae220}
- Instance ID: {7e631031-c695-4229-9da1-a7de057e64cb}
* WRITER Shadow Copy Optimization Writer
- Status: 1 (VSS_WS_STABLE)
- Writer Failure code: 0x00000000 (S_OK)
- Writer ID: {4dc3bdd4-ab48-4d07-adb0-3bee2926fd7f}
- Instance ID: {9e362607-9794-4dd4-a7cd-b3d5de0aad20}
* WRITER Registry Writer
- Status: 1 (VSS_WS_STABLE)
- Writer Failure code: 0x00000000 (S_OK)
- Writer ID: {afbab4a2-367d-4d15-a586-71dbb18f8485}
- Instance ID: {e87ba7e3-f8d8-42d8-b2ee-c76ae26b98e8}
8 writers listed.
Loads a metadata .cab file prior to importing a transportable shadow copy or loads the writer metadata in the case of a restore. If used without parameters, load metadata displays help at the command prompt.
load metadata [<drive>:][<path>]<metadata.cab>
Parameter | Description |
---|---|
[<drive>:][<path>] |
Specifies the location of the metadata file. |
metadata.cab | Specifies the metadata .cab file to load. |
You can use the import command to import a transportable shadow copy based on the metadata specified by load metadata.
You must run this command before the begin restore command, to load the selected writers and components for the restore.
To load a metadata file called metafile.cab from the default location, type:
load metadata metafile.cab
Displays a list of basic and dynamic volumes on all disks.
list volume
To list the detected volumes, type:
list volume
To delete volume 2, type:
delete volume=2
Lists shadow copy providers that are currently registered on the system.
list providers
To list the currently registered shadow copy providers, type:
list providers
Output that is similar to the following displays:
* ProviderID: {b5946137-7b9f-4925-af80-51abd60b20d5}
Type: [1] VSS_PROV_SYSTEM
Name: Microsoft Software Shadow Copy provider 1.0
Version: 1.0.0.7
CLSID: {65ee1dba-8ff4-4a58-ac1c-3470ee2f376a}
1 provider registered.
Sets the password for the local computer. This command affects the computer account only and requires a restart for the password change to take effect.
[!IMPORTANT] The computer account password isn't displayed in the registry or as output from the ksetup command.
ksetup /setcomputerpassword <password>
Parameter | Description |
---|---|
<password> |
Specifies the supplied password to set the computer account on the local computer. The password can only be set by using an account with administrative privileges, and the password must be from 1 to 156 alphanumeric or special characters. |
To change the computer account password on the local computer from IPops897 to IPop$897!, type:
ksetup /setcomputerpassword IPop$897!
Lists the available realm flags that can be reported by ksetup.
ksetup /listrealmflags
Value | Realm flag | Description |
---|---|---|
0xF | All | All realm flags are set. |
0x00 | None | No realm flags are set, and no additional features are enabled. |
0x01 | sendaddress | The IP address will be included within the ticket-granting tickets. |
0x02 | tcpsupported | Both the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) are supported in this realm. |
0x04 | delegate | Everyone in this realm is trusted for delegation. |
0x08 | ncsupported | This realm supports name canonicalization, which allows for DNS and Realm naming standards. |
0x80 | rc4 | This realm supports RC4 encryption to enable cross-realm trust, which allows for the use of TLS. |
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Domains\<realmname>
. This entry doesn't exist in the registry by default. You can use the ksetup addrealmflags command to populate the registry.To list the known realm flags on this computer, type:
ksetup /listrealmflags
To set the available realm flags that ksetup doesn't know, type:
ksetup /setrealmflags CORP.CONTOSO.COM sendaddress tcpsupported delete ncsupported
-OR-
ksetup /setrealmflags CORP.CONTOSO.COM 0xF
Removes the encryption type attribute for the domain. A status message is displayed upon successful or failed completion.
You can view the encryption type for the Kerberos ticket-granting ticket (TGT) and the session key, by running the klist command and viewing the output. You can set the domain to connect to and use, by running the ksetup /domain <domainname>
command.
ksetup /delenctypeattr <domainname>
Parameter | Description |
---|---|
<domainname> |
Name of the domain to which you want to establish a connection. You can use either the fully-qualified domain name or a simple form of the name, such as corp.contoso.com or contoso. |
To determine the current encryption types that are set on this computer, type:
klist
To set the domain to mit.contoso.com, type:
ksetup /domain mit.contoso.com
To verify what the encryption type attribute is for the domain, type:
ksetup /getenctypeattr mit.contoso.com
To remove the set encryption type attribute for the domain mit.contoso.com, type:
ksetup /delenctypeattr mit.contoso.com
Removes a service principal name (SPN) mapping between the stated host and the realm. This command also removes any mapping between a host to realm (or multiple hosts to realm).
The mapping is stored in the registry, under HKEY_LOCAL_MACHINE\SYSTEM\CurrentContolSet\Control\Lsa\Kerberos\HostToRealm
. After running this command, we recommend making sure the mapping appears in the registry.
ksetup /delhosttorealmmap <hostname> <realmname>
Parameter | Description |
---|---|
<hostname> |
Specifies the fully-qualified domain name of the computer. |
<realmname> |
Specifies the uppercase DNS name, such as CORP.CONTOSO.COM. |
To change the configuration of the realm CONTOSO, and to delete the mapping of the host computer IPops897 to the realm, type:
ksetup /delhosttorealmmap IPops897 CONTOSO
Uses the Key Distribution Center (KDC) password (kpasswd) value to change the password of the logged-on user. The output of the command informs you of the success or failure status.
You can check whether the kpasswd is set, by running the ksetup /dumpstate
command and viewing the output.
ksetup /changepassword <oldpassword> <newpassword>
Parameter | Description |
---|---|
<oldpassword> |
Specifies the logged-on user's existing password. |
<newpassword> |
Specifies the logged on user's new password. This password must meet all the password requirements set on this computer. |
If the user account isn't found in the current domain, the system will ask you to supply the domain name where the user account resides.
If you want to force a password change at next logon, this command allows the use of the asterisk (*) so the user will be prompted for a new password.
-
To change the password of a user who is currently logged on to this computer in this domain, type:
ksetup /changepassword Pas$w0rd Pa$$w0rd
To change the password of a user who is currently logged on in the Contoso domain, type:
ksetup /domain CONTOSO /changepassword Pas$w0rd Pa$$w0rd
To force the currently logged on user to change the password at the next logon, type:
ksetup /changepassword Pas$w0rd *
Adds a Key Distribution Center (KDC) address for the given Kerberos realm
The mapping is stored in the registry, under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\LSA\Kerberos\Domains and the computer must be restarted before the new realm setting will be used.
[!NOTE] To deploy Kerberos realm configuration data to multiple computers, you must use the Security Configuration Template snap-in and policy distribution, explicitly on individual computers. You can't use this command.
ksetup /addkdc <realmname> [<KDCname>]
Parameter | Description |
---|---|
<realmname> |
Specifies the uppercase DNS name, such as CORP.CONTOSO.COM. This value also appears as the default realm when ksetup is run, and is the realm to which you want to add the other KDC. |
<KDCname> |
Specifies the case-insensitive, fully-qualified domain name, such as mitkdc.contoso.com. If the KDC name is omitted, DNS will locate KDCs. |
To configure a non-Windows KDC server and the realm that the workstation should use, type:
ksetup /addkdc CORP.CONTOSO.COM mitkdc.contoso.com
To set the local computer account password to p@sswrd1% on the same computer as in the previous example, and then to restart the computer, type:
ksetup /setcomputerpassword p@sswrd1%
To verify the default realm name for the computer or to verify that this command worked as intended, type:
ksetup
Check the registry to make sure the mapping occurred as intended.
Performs tasks related to setting up and maintaining Kerberos protocol and the Key Distribution Center (KDC) to support Kerberos realms. Specifically, this command is used to:
Change the computer settings for locating Kerberos realms. In non-Microsoft, Kerberos–based implementations, this information is usually kept in the Krb5.conf file. In Windows Server operating systems, it's kept in the registry. You can use this tool to modify these settings. These settings are used by workstations to locate Kerberos realms and by domain controllers to locate Kerberos realms for cross-realm trust relationships.
Initialize registry keys that the Kerberos Security Support Provider (SSP) uses to locate a KDC for the Kerberos realm, if the computer is isn't a member of a Windows domain. After configuration, the user of a client computer running the Windows operating system can log on to accounts in the Kerberos realm.
Search the registry for the domain name of the user's realm and then resolves the name to an IP address by querying a DNS server. The Kerberos protocol can use DNS to locate KDCs by using only the realm name, but it must be specially configured to do so.
ksetup
[/setrealm <DNSdomainname>]
[/mapuser <principal> <account>]
[/addkdc <realmname> <KDCname>]
[/delkdc <realmname> <KDCname>]
[/addkpasswd <realmname> <KDCPasswordName>]
[/delkpasswd <realmname> <KDCPasswordName>]
[/server <servername>]
[/setcomputerpassword <password>]
[/removerealm <realmname>]
[/domain <domainname>]
[/changepassword <oldpassword> <newpassword>]
[/listrealmflags]
[/setrealmflags <realmname> [sendaddress] [tcpsupported] [delegate] [ncsupported] [rc4]]
[/addrealmflags <realmname> [sendaddress] [tcpsupported] [delegate] [ncsupported] [rc4]]
[/delrealmflags [sendaddress] [tcpsupported] [delegate] [ncsupported] [rc4]]
[/dumpstate]
[/addhosttorealmmap] <hostname> <realmname>]
[/delhosttorealmmap] <hostname> <realmname>]
[/setenctypeattr] <domainname> {DES-CBC-CRC | DES-CBC-MD5 | RC4-HMAC-MD5 | AES128-CTS-HMAC-SHA1-96 | AES256-CTS-HMAC-SHA1-96}
[/getenctypeattr] <domainname>
[/addenctypeattr] <domainname> {DES-CBC-CRC | DES-CBC-MD5 | RC4-HMAC-MD5 | AES128-CTS-HMAC-SHA1-96 | AES256-CTS-HMAC-SHA1-96}
[/delenctypeattr] <domainname>
Parameter | Description |
---|---|
ksetup setrealm | Makes this computer a member of a Kerberos realm. |
ksetup addkdc | Defines a KDC entry for the given realm. |
ksetup delkdc | Deletes a KDC entry for the realm. |
ksetup addkpasswd | Adds a kpasswd server address for a realm. |
ksetup delkpasswd | Deletes a kpasswd server address for a realm. |
ksetup server | Allows you to specify the name of a Windows computer on which to apply the changes. |
ksetup setcomputerpassword | Sets the password for the computer's domain account (or host principal). |
ksetup removerealm | Deletes all information for the specified realm from the registry. |
ksetup domain | Allows you to specify a domain (if the <domainname> hasn't already been set by the /domain parameter). |
ksetup changepassword | Allows you to use the kpasswd to change the logged on user's password. |
ksetup listrealmflags | Lists the available realm flags that ksetup can detect. |
ksetup setrealmflags | Sets realm flags for a specific realm. |
ksetup addrealmflags | Adds additional realm flags to a realm. |
ksetup delrealmflags | Deletes realm flags from a realm. |
ksetup dumpstate | Analyzes the Kerberos configuration on the given computer. Adds a host to realm mapping to the registry. |
ksetup addhosttorealmmap | Adds a registry value to map the host to the Kerberos realm. |
ksetup delhosttorealmmap | Deletes the registry value that mapped the host computer to the Kerberos realm. |
ksetup setenctypeattr | Sets one or more encryption types trust attributes for the domain. |
ksetup getenctypeattr | Gets the encryption types trust attribute for the domain. |
ksetup addenctypeattr | Adds encryption types to the encryption types trust attribute for the domain. |
ksetup delenctypeattr | Deletes the encryption types trust attribute for the domain. |
/? | Displays Help at the command prompt. |
Adds the encryption type attribute to the list of possible types for the domain. A status message is displayed upon successful or failed completion.
ksetup /addenctypeattr <domainname> {DES-CBC-CRC | DES-CBC-MD5 | RC4-HMAC-MD5 | AES128-CTS-HMAC-SHA1-96 | AES256-CTS-HMAC-SHA1-96}
Parameter | Description |
---|---|
<domainname> |
Name of the domain to which you want to establish a connection. Use the fully qualified domain name or a simple form of the name, such as corp.contoso.com or contoso. |
encryption type | Must be one of the following supported encryption types:
|
To view the encryption type for the Kerberos ticket-granting ticket (TGT) and the session key, type:
klist
To set the domain to corp.contoso.com, type:
ksetup /domain corp.contoso.com
To add the encryption type AES-256-CTS-HMAC-SHA1-96 to the list of possible types for the domain corp.contoso.com, type:
ksetup /addenctypeattr corp.contoso.com AES-256-CTS-HMAC-SHA1-96
To set the encryption type attribute to AES-256-CTS-HMAC-SHA1-96 for the domain corp.contoso.com, type:
ksetup /setenctypeattr corp.contoso.com AES-256-CTS-HMAC-SHA1-96
To verify that the encryption type attribute was set as intended for the domain, type:
ksetup /getenctypeattr corp.contoso.com
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Returns the media access control (MAC) address and list of network protocols associated with each address for all network cards in each computer, either locally or across a network. This command is particularly useful either when you want to enter the MAC address into a network analyzer, or when you need to know what protocols are currently in use on each network adapter on a computer.
getmac[.exe][/s <computer> [/u <domain\<user> [/p <password>]]][/fo {table | list | csv}][/nh][/v]
Parameter | Description |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer. |
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by user or domain\user. The default is the permissions of the current logged on user on the computer issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
/fo {table | list | csv} | Specifies the format to use for the query output. Valid values are table, list, and csv. The default format for output is table. |
/nh | Suppresses column header in output. Valid when the /fo parameter is set to table or csv. |
/v | Specifies that the output display verbose information. |
/? | Displays help at the command prompt. |
The following examples show how you can use the getmac command:
getmac /fo table /nh /v
getmac /s srvmain
getmac /s srvmain /u maindom\hiropln
getmac /s srvmain /u maindom\hiropln /p p@ssW23
getmac /s srvmain /u maindom\hiropln /p p@ssW23 /fo list /v
getmac /s srvmain /u maindom\hiropln /p p@ssW23 /fo table /nh
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays a directory list of files and subdirectories in a remote directory.
mdir <remotefile>[...] <localfile>
Parameter | Description |
---|---|
<remotefile> |
Specifies the directory or file for which you want to see a listing. You can specify multiple remotefiles. Type a hyphen (-) to use the current working directory on the remote computer. |
<localfile> |
Specifies a local file to store the listing. This parameter is required. Type a hyphen (-) to display the listing on the screen. |
To display a directory listing of dir1 and dir2 on the screen, type:
mdir dir1 dir2 -
To save the combined directory listing of dir1 and dir2 in a local file called dirlist.txt, type:
mdir dir1 dir2 dirlist.txt
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Copies a local file to the remote computer using the current file transfer type.
[!NOTE] This command is the same as the ftp send command.
put <localfile> [<remotefile>]
Parameter | Description |
---|---|
<localfile> |
Specifies the local file to copy. |
[<remotefile>] |
Specifies the name to use on the remote computer. If you don't specify a remotefile, the file is give the localfile name. |
To copy the local file test.txt and name it test1.txt on the remote computer, type:
put test.txt test1.txt
To copy the local file program.exe to the remote computer, type:
put program.exe
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays a list of directory files and subdirectories on a remote computer.
dir [<remotedirectory>] [<localfile>]
Parameter | Description |
---|---|
[<remotedirectory>] |
Specifies the directory for which you want to see a listing. If no directory is specified, the current working directory on the remote computer is used. |
[<localfile>] |
Specifies a local file in which to store the directory listing. If a local file is not specified, results are displayed on the screen. |
To display a directory listing for dir1 on the remote computer, type:
dir dir1
To save a list of the current directory on the remote computer in the local file dirlist.txt, type:
dir . dirlist.txt
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Ends the ftp session on the remote computer, and then exits.
[!NOTE] This command is the same as the ftp quit command.
bye
To end the ftp session with the remote computer and exit, type:
bye
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10
Provides functions to discover and manage Windows Image (WIM)-backed files.
fsutil wim [enumfiles] <drive name> <data source>
fsutil wim [enumwims] <drive name>
fsutil wim [queryfile] <filename>
fsutil wim [removewim] <drive name> <data source>
Parameter | Description |
---|---|
enumfiles | Enumerates WIM backed files. |
<drive name> |
Specifies the drive name. |
<data source> |
Specifies the data source. |
enumwims | Enumerates backing WIM files. |
queryfile | Queries if the file is backed by WIM, and if so, displays details about the WIM file. |
<filename> |
Specifies the filename. |
removewim | Removes a WIM from backing files. |
To enumerate the files for drive C: from data source 0, type:
fsutil wim enumfiles C: 0
To enumerate backing WIM files for drive C:, type:
fsutil wim enumwims C:
To see if a file is backed by WIM, type:
fsutil wim queryFile C:\Windows\Notepad.exe
To remove the WIM from backing files for volume C: and data source 2, type:
fsutil wim removewims C: 2
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Appends a local file to a file on the remote computer using the current file type setting.
append <localfile> [remotefile]
Parameter | Description |
---|---|
<localfile> |
Specifies the local file to add. |
[remotefile] | Specifies the file on the remote computer to which <localfile> is added. If you don't use this parameter, the <localfile> name is used in place of the remote file name. |
To append file1.txt to file2.txt on the remote computer, type:
append file1.txt file2.txt
To append the local file1.txt to a file named file1.txt on the remote computer.
append file1.txt
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8
Dismounts a volume, or queries the hard disk drive to determine how much free space is currently available on the hard disk drive or which file is using a particular cluster.
fsutil volume [allocationreport] <volumepath>
fsutil volume [diskfree] <volumepath>
fsutil volume [dismount] <volumepath>
fsutil volume [filelayout] <volumepath> <fileID>
fsutil volume [list]
fsutil volume [querycluster] <volumepath> <cluster> [<cluster>] … …
Parameter | Description |
---|---|
allocationreport | Displays information about how storage is used on a given volume. |
<volumepath> |
Specifies the drive letter (followed by a colon). |
diskfree | Queries the hard disk drive to determine the amount of free space on it. |
dismount | Dismounts a volume. |
filelayout | Displays NTFS metadata for the given file. |
<fileID> |
Specifies the file id. |
list | Lists all of the volumes on the system. |
querycluster | Finds which file is using a specified cluster. You can specify multiple clusters with the querycluster parameter. |
<cluster> |
Specifies the logical cluster number (LCN). |
To display an allocated clusters report, type:
fsutil volume allocationreport C:
To dismount a volume on drive C, type:
fsutil volume dismount c:
To query the amount of free space of a volume on drive C, type:
fsutil volume diskfree c:
To display all the information about a specified file(s), type:
fsutil volume C: *
fsutil volume C:\Windows
fsutil volume C: 0x00040000000001bf
To list the volumes on disk, type:
fsutil volume list
To find the file(s) that are using the clusters, specified by the logical cluster numbers 50 and 0x2000, on drive C, type:
fsutil volume querycluster C: 50 0x2000
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10
Enables management of storage tier functions, such as setting and disabling flags and listing of tiers.
fsutil tiering [clearflags] <volume> <flags>
fsutil tiering [queryflags] <volume>
fsutil tiering [regionlist] <volume>
fsutil tiering [setflags] <volume> <flags>
fsutil tiering [tierlist] <volume>
Parameter | Description |
---|---|
clearflags | Disables the tiering behavior flags of a volume. |
<volume> |
Specifies the volume. |
/trnh | For volumes with tiered storage, causes Heat gathering to be disabled. Applies to NTFS and ReFS only. |
queryflags | Queries the tiering behavior flags of a volume. |
regionlist | Lists the tiered regions of a volume and their respective storage tiers. |
setflags | Enables the tiering behavior flags of a volume. |
tierlist | Lists the storage tiers associated with a volume. |
To query the flags on volume C, type:
fsutil tiering queryflags C:
To set the flags on volume C, type:
fsutil tiering setflags C: /trnh
To clear the flags on volume C, type:
fsutil tiering clearflags C: /trnh
To list the regions of volume C and their respective storage tiers, type:
fsutil tiering regionlist C:
To list the tiers of volume C, type:
fsutil tiering tierlist C:
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8
Queries or deletes reparse points. The fsutil reparsepoint command is typically used by support professionals.
Reparse points are NTFS file system objects that have a definable attribute, which contains user-defined data. They're used to:
Extend functionality in the input/output (I/O) subsystem.
Act as directory junction points and volume mount points.
Mark certain files as special to a file system filter driver.
fsutil reparsepoint [query] <filename>
fsutil reparsepoint [delete] <filename>
Parameter | Description |
---|---|
query | Retrieves the reparse point data that is associated with the file or directory identified by the specified handle. |
delete | Deletes a reparse point from the file or directory that is identified by the specified handle, but does not delete the file or directory. |
<filename> |
Specifies the full path to the file including the file name and extension, for example C:\documents\filename.txt. |
To retrieve reparse point data associated with c:\server, type:
fsutil reparsepoint query c:\server
To delete a reparse point from a specified file or directory, use the following format:
fsutil reparsepoint delete c:\server
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8
Manages sparse files. A sparse file is a file with one or more regions of unallocated data in it.
A program sees these unallocated regions as containing bytes with a zero value and that there's no disk space representing these zeros. When a sparse file is read, allocated data is returned as stored, and unallocated data is returned, by default, as zeros, in accordance with the C2 security requirement specification. Sparse file support allows data to be deallocated from anywhere in the file.
fsutil sparse [queryflag] <filename>
fsutil sparse [queryrange] <filename>
fsutil sparse [setflag] <filename>
fsutil sparse [setrange] <filename> <beginningoffset> <length>
Parameter | Description |
---|---|
queryflag | Queries sparse. |
queryrange | Scans a file and searches for ranges that may contain nonzero data. |
setflag | Marks the indicated file as sparse. |
setrange | Fills a specified range of a file with zeros. |
<filename> |
Specifies the full path to the file including the file name and extension, for example C:\documents\filename.txt. |
<beginningoffset> |
Specifies the offset within the file to mark as sparse. |
<length> |
Specifies the length of the region in the file to be marked as sparse (in bytes). |
All meaningful or nonzero data is allocated, whereas all non-meaningful data (large strings of data that is composed of zeros) is not allocated.
In a sparse file, large ranges of zeroes may not require disk allocation. Space for nonzero data is allocated as needed when the file is written.
Only compressed or sparse files can have zeroed ranges known to the operating system.
If the file is sparse or compressed, NTFS may de-allocate disk space within the file. This sets the range of bytes to zeroes without extending the file size.
To mark a file named sample.txt in the c:\temp directory as sparse, type:
fsutil sparse setflag c:\temp\sample.txt
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8
Creates a hard link between an existing file and a new file. A hard link is a directory entry for a file. Every file can be considered to have at least one hard link.
On NTFS volumes, each file can have multiple hard links, so a single file can appear in many directories (or even in the same directory with different names). Because all of the links reference the same file, programs can open any of the links and modify the file. A file is deleted from the file system only after all links to it have been deleted. After you create a hard link, programs can use it like any other file name.
fsutil hardlink create <newfilename> <existingfilename>
fsutil hardlink list <filename>
Parameter | Description |
---|---|
create | Establishes an NTFS hard link between an existing file and a new file. (An NTFS hard link is similar to a POSIX hard link.) |
<newfilename> | Specifies the file that you want to create a hard link to. |
<existingfilename> | Specifies the file that you want to create a hard link from. |
list | Lists the hard links to filename. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Enables Windows optional features by downloading required files from Windows Update or another source specified by Group Policy. The manifest file for the feature must already be installed in your Windows image.
fondue.exe /enable-feature:<feature_name> [/caller-name:<program_name>] [/hide-ux:{all | rebootrequest}]
Parameter | Description | |
---|---|---|
/enable-feature:<feature_name> |
Specifies the name of the Windows optional feature you want to enable. You can only enable one feature per command line. To enable multiple features, use fondue.exe for each feature. | |
/caller-name:<program_name> |
Specifies the program or process name when you call fondue.exe from a script or batch file. You can use this option to add the program name to the SQM report if there is an error. | |
/hide-ux:`{all | rebootrequest}` | Use all to hide all messages to the user including progress and permission requests to access Windows Update. If permission is required, the operation will fail. Use rebootrequest to only hide user messages asking for permission to reboot the computer. Use this option if you have a script that controls reboot requests. |
To enable Microsoft .NET Framework 4.8, type:
fondue.exe /enable-feature:NETFX4
To enable Microsoft .NET Framework 4.8, add the program name to the SQM report, and not display messages to the user, type:
fondue.exe /enable-feature:NETFX4 /caller-name:Admin.bat /hide-ux:all
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Extends the volume or partition with focus and its file system into free (unallocated) space on a disk.
extend [size=<n>] [disk=<n>] [noerr]
extend filesystem [noerr]
Parameter | Description |
---|---|
size=<n> |
Specifies the amount of space in megabytes (MB) to add to the current volume or partition. If no size is given, all of the contiguous free space that is available on the disk is used. |
disk=<n> |
Specifies the disk on which the volume or partition is extended. If no disk is specified, the volume or partition is extended on the current disk. |
filesystem | Extends the file system of the volume with focus. For use only on disks where the file system was not extended with the volume. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
On basic disks, the free space must be on the same disk as the volume or partition with focus. It must also immediately follow the volume or partition with focus (that is, it must start at the next sector offset).
On dynamic disks with simple or spanned volumes, a volume can be extended to any free space on any dynamic disk. Using this command, you can convert a simple dynamic volume into a spanned dynamic volume. Mirrored, RAID-5 and striped volumes cannot be extended.
If the partition was previously formatted with the NTFS file system, the file system is automatically extended to fill the larger partition and no data loss will occur.
If the partition was previously formatted with a file system other than NTFS, the command fails with no change to the partition.
If the partition was not previously formatted with a file system, the partition will still be extended.
The partition must have an associated volume before it can be extended.
To extend the volume or partition with focus by 500 megabytes, on disk 3, type:
extend size=500 disk=3
To extend the file system of a volume after it was extended, type:
extend filesystem
Runs a script file on the local computer. This command also duplicates or restores data as part of a backup or restore sequence. If the script fails, an error is returned and DiskShadow quits.
The file can be a cmd script.
exec <scriptfile.cmd>
Parameter | Description |
---|---|
<scriptfile.cmd> |
Specifies the script file to run. |
The eventtriggers command has been deprecated and isn't guaranteed to be supported in future releases of Windows.
Ends localization of environment changes in a batch file, and restores environment variables to their values before the corresponding setlocal command was run.
endlocal
Parameter | Description |
---|---|
/? | Displays help at the command prompt. |
The endlocal command has no effect outside a script or batch file.
There is an implicit endlocal command at the end of a batch file.
If command extensions are enabled (command extensions are enabled by default), the endlocal command restores the state of command extensions (that is, enabled or disabled) to what it was before the corresponding setlocal command was run.
[!NOTE] For more information about enabling and disabling command extensions, see the Cmd command.
You can localize environment variables in a batch file. For example, the following program starts the superapp batch program on the network, directs the output to a file, and displays the file in Notepad:
@echo off
setlocal
path=g:\programs\superapp;%path%
call superapp>c:\superapp.out
endlocal
start notepad c:\superapp.out
Starts the MS-DOS Editor, which creates and changes ASCII text files.
edit [/b] [/h] [/r] [/s] [/<nnn>] [[<drive>:][<path>]<filename> [<filename2> [...]]
Parameter | Description |
---|---|
[<drive>:][<path>]<filename> [<filename2> [...]] |
Specifies the location and name of one or more ASCII text files. If the file doens't exist, MS-DOS Editor creates it. If the file exists, MS-DOS Editor opens it and displays its contents on the screen. The filename option can contain wildcard characters (* and ?). Separate multiple file names with spaces. |
/b | Forces monochrome mode, so that MS-DOS Editor displays in black and white. |
/h | Displays the maximum number of lines possible for the current monitor. |
/r | Loads file(s) in read-only mode. |
/s | Forces the use of short filenames. |
<nnn> |
Loads binary file(s), wrapping lines to nnn characters wide. |
/? | Displays help at the command prompt. |
For additional help, open MS-DOS Editor, and then press the F1 key.
Some monitors don't support the display of shortcut keys by default. If your monitor doesn't display shortcut keys, use /b.
To open MS-DOS Editor, type:
edit
To create and edit a file named newtextfile.txt in the current directory, type:
edit newtextfile.txt
Enables an administrator to display a list of installed device drivers and their properties. If used without parameters, driverquery runs on the local computer.
driverquery [/s <system> [/u [<domain>\]<username> [/p <password>]]] [/fo {table | list | csv}] [/nh] [/v | /si]
Parameter | Description |
---|---|
/s <system> |
Specifies the name or IP address of a remote computer. Do not use backslashes. The default is the local computer. |
/u [<domain>]<username> |
Runs the command with the credentials of the user account as specified by user or domain\user. By default, /s uses the credentials of the user who is currently logged on to the computer that is issuing the command. /u can't be used unless /s is specified. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. /p cannot be used unless /u is specified. |
/fo table | Formats the output as a table. This is the default. |
/fo list | Formats the output as a list. |
/fo csv | Formats the output with comma-separated values. |
/nh | Omits the header row from the displayed driver information. Not valid if the /fo parameter is set to list. |
/v | Displays verbose output. /v is not valid for signed drivers. |
/si | Provides information about signed drivers. |
/? | Displays help at the command prompt. |
To display a list of installed device drivers on the local computer, type:
driverquery
To display the output in a comma-separated values (CSV) format, type:
driverquery /fo csv
To hide the header row in the output, type:
driverquery /nh
To use the driverquery command on a remote server named server1 using your current credentials on the local computer, type:
driverquery /s server1
To use the driverquery command on a remote server named server1 using the credentials for user1 on the domain maindom, type:
driverquery /s server1 /u maindom\user1 /p p@ssw3d
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Checks Distributed File System (DFS) referrals by performing the following tests:
If you use the DFSpath* parameter without arguments, the command validates that the referral list includes all trusted domains.
If you specify a domain, the command performs a health check of domain controllers (dfsdiag /testdcs
) and tests the site associations and domain cache of the local host.
If you specify a domain and \SYSvol or \NETLOGON, the command performs the same domain controller health checks, along with checking that the time To Live (TTL) of SYSvol or NETLOGON referrals matches the default value of 900 seconds.
If you specify a namespace root, the command performs the same domain controller health checks, along with performing a DFS configuration check (dfsdiag /testdfsconfig
) and a namespace integrity check (dfsdiag /testdfsintegrity
).
If you specify a DFS folder (link), the command performs the same namespace root health checks, along with validating the site configuration for folder targets (dfsdiag /testsites) and validating the site association of the local host.
dfsdiag /testreferral /DFSpath:<DFS path to get referrals> [/full]
Parameter | Description |
---|---|
/DFSpath:<path to get referrals> |
Can be one of the following:
|
/full | Applies only to Domain and Root referrals. Verifies the consistency of site association information between the registry and active directory Domain Services (AD DS). |
To check the Distributed File System (DFS) referrals in contoso.com\MyNamespace, type:
dfsdiag /testreferral /DFSpath:\\contoso.com\MyNamespace
To check the Distributed File System (DFS) referrals in all trusted domains, type:
dfsdiag /testreferral /DFSpath:
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Checks the configuration of active directory Domain Services (AD DS) sites by verifying that servers that act as namespace servers or folder (link) targets have the same site associations on all domain controllers.
dfsdiag /testsites </machine:<server name>| /DFSpath:<namespace root or DFS folder> [/recurse]> [/full]
Parameter | Description |
---|---|
/machine:<server name> |
The name of the server on which to verify the site association. |
/DFSpath:<namespace root or DFS folder> |
The namespace root or Distributed File System (DFS) folder (link) with targets for which to verify the site association. |
/recurse | Enumerates and verifies the site associations for all folder targets under the specified namespace root. |
/full | Verifies that AD DS and the registry of the server contain the same site association information. |
To check the site associations on machine\MyServer, type:
dfsdiag /testsites /machine:MyServer
To check a Distributed File System (DFS) folder to verify the site association, along with verifying that AD DS and the registry of the server contain the same site association information, type:
dfsdiag /TestSites /DFSpath:\\contoso.com\namespace1\folder1 /full
To check a namespace root to verify the site association, along with enumerating and verifying the site associations for all folder targets under the specified namespace root, and verifying that AD DS and the registry of the server contain the same site association information, type:
dfsdiag /testsites /DFSpath:\\contoso.com\namespace2 /recurse /full
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Checks the integrity of the Distributed File System (DFS) namespace by performing the following tests:
Checks for DFS metadata corruption or inconsistencies between domain controllers.
Validates the configuration of access-based enumeration to ensure that it is consistent between DFS metadata and the namespace server share.
Detects overlapping DFS folders (links), duplicate folders, and folders with overlapping folder targets.
dfsdiag /testdfsintegrity /DFSroot: <DFS root path> [/recurse] [/full]
Parameter | Description |
---|---|
/DFSroot: <DFS root path> |
The DFS namespace to diagnose. |
/recurse | Performs the testing, including any namespace interlinks. |
/full | Verifies the consistency of the share and NTFS ACLs, along with the client side configuration on all folder targets. It also verifies that the online property is set. |
To verify the integrity and consistency of the Distributed File System (DFS) namespaces in contoso.com\MyNamespace, including any interlinks, type:
dfsdiag /testdfsintegrity /DFSRoot:\contoso.com\MyNamespace /recurse /full
Provides diagnostic information for DFS Namespaces.
dfsdiag /testdcs [/domain:<domain name>]
dfsdiag /testsites </machine:<server name>| /DFSPath:<namespace root or DFS folder> [/recurse]> [/full]
dfsdiag /testdfsconfig /DFSRoot:<namespace>
dfsdiag /testdfsintegrity /DFSRoot:<DFS root path> [/recurse] [/full]
dfsdiag /testreferral /DFSpath:<DFS path to get referrals> [/full]
Parameter | Description |
---|---|
dfsdiag testdcs | Checks domain controller configuration. |
dfsdiag testsites | Checks site associations. |
dfsdiag testdfsconfig | Checks DFS Namespace configuration. |
dfsdiag testdfsintegrity | Checks DFS Namespace integrity. |
dfsdiag testreferral | Checks referral responses. |
/? | Displays help at the command prompt. |
Displays the disks on which the current volume resides. Before you begin, you must select a volume for this operation to succeed. Use the select volume command to select a volume and shift the focus to it. The volume details aren't applicable to read-only volumes, such as a DVD-ROM or CD-ROM drive.
detail volume
To see all the disks in which the current volume resides, type:
detail volume
Displays the properties of the selected disk and the volumes on that disk. Before you begin, you must select a disk for this operation to succeed. Use the select disk command to select a disk and shift the focus to it. If you select a virtual hard disk (VHD), this command will show the disk's bus type as Virtual.
detail disk
To see the properties of the selected disk, and information about the volumes in the disk, type:
detail disk
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Stops the selected virtual hard disk (VHD) from appearing as a local hard disk drive on the host computer. When a VHD is detached, you can copy it to other locations. Before you begin, you must select a VHD for this operation to succeed. Use the select vdisk command to select a VHD and shift the focus to it.
detach vdisk [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To detach the selected VHD, type:
detach vdisk
Deletes the partition with focus. Before you begin, you must select a partition for this operation to succeed. Use the select partition command to select a partition and shift the focus to it.
[!WARNING] Deleting a partition on a dynamic disk can delete all dynamic volumes on the disk, destroying any data and leaving the disk in a corrupt state.
You can't delete the system partition, boot partition, or any partition that contains the active paging file or crash dump information.
delete partition [noerr] [override]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
override | Enables DiskPart to delete any partition regardless of type. Typically, DiskPart only permits you to delete known data partitions. |
To delete a dynamic volume, always use the delete volume command instead.
Partitions can be deleted from dynamic disks, but they shouldn't be created. For example, it's possible to delete an unrecognized GUID Partition Table (GPT) partition on a dynamic GPT disk. Deleting such a partition doesn't cause the resulting free space to become available. Instead, This command is intended to allow you to reclaim space on a corrupted offline dynamic disk in an emergency situation where the clean command in DiskPart can't be used.
To delete the partition with focus, type:
delete partition
Deletes a partition or a volume. It also deletes a dynamic disk from the list of disks.
delete disk
delete partition
delete shadows
delete volume
Parameter | Description |
---|---|
Delete disk | Deletes a missing dynamic disk from the list of disks. |
Delete partition | Deletes a partition. |
Delete shadows | Deletes shadow copies. |
Delete volume | Deletes a volume. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a RAID-5 volume using three or more specified dynamic disks. After you create the volume, the focus automatically shifts to the new volume.
create volume raid [size=<n>] disk=<n>,<n>,<n>[,<n>,...] [align=<n>] [noerr]
Parameter | Description |
---|---|
size=<n> |
The amount of disk space, in megabytes (MB), that the volume will occupy on each disk. If no size is given, the largest possible RAID-5 volume will be created. The disk with the smallest available contiguous free space determines the size for the RAID-5 volume and the same amount of space is allocated from each disk. The actual amount of usable disk space in the RAID-5 volume is less than the combined amount of disk space because some of the disk space is required for parity. |
disk=<n>,<n>,<n>[,<n>,...] |
The dynamic disks on which to create the RAID-5 volume. You need at least three dynamic disks in order to create a RAID-5 volume. An amount of space equal to size=<n> is allocated on each disk. |
align=<n> |
Aligns all volume extents to the closest alignment boundary. Typically used with hardware RAID Logical Unit Number (LUN) arrays to improve performance. <n> is the number of kilobytes (KB) from the beginning of the disk to the closest alignment boundary. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To create a RAID-5 volume of 1000 megabytes in size, using disks 1, 2 and 3, type:
create volume raid size=1000 disk=1,2,3
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a volume mirror by using the two specified dynamic disks. After the volume has been created, the focus automatically shifts to the new volume.
create volume mirror [size=<n>] disk=<n>,<n>[,<n>,...] [align=<n>] [noerr]
Parameter | Description |
---|---|
size=<n> |
Specifies the amount of disk space, in megabytes (MB), that the volume will occupy on each disk. If no size is given, the new volume takes up the remaining free space on the smallest disk and an equal amount of space on each subsequent disk. |
disk=<n> ,<n> [,<n>,... ] |
Specifies the dynamic disks on which the mirror volume is created. You need two dynamic disks to create a mirror volume. An amount of space that is equal to the size specified with the size parameter is allocated on each disk. |
align=<n> |
Aligns all volume extents to the closest alignment boundary. This parameter is typically used with hardware RAID logical unit number (LUN) arrays to improve performance. <n> is the number of kilobytes (KB) from the beginning of the disk to the closest alignment boundary. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error. |
To create a mirrored volume of 1000 megabytes in size, on disks 1 and 2, type:
create volume mirror size=1000 disk=1,2
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates an extended partition on the disk with focus. After the partition has been created, the focus automatically shifts to the new partition.
[!IMPORTANT] You can use this command only on Master Boot Record (MBR) disks. You must use the select disk command to select a basic MBR disk and shift the focus to it.
You must create an extended partition before you can create logical drives. Only one extended partition can be created per disk. This command fails if you attempt to create an extended partition within another extended partition.
create partition extended [size=<n>] [offset=<n>] [align=<n>] [noerr]
Parameter | Description |
---|---|
size=<n> |
Specifies the size of the partition in megabytes (MB). If no size is given, the partition continues until there is no more free space in the extended partition. |
offset=<n> |
Specifies the offset in kilobytes (KB), at which the partition is created. If no offset is given, the partition will start at the beginning of the free space on the disk that is large enough to hold the new partition. |
align=<n> |
Aligns all partition extents to the closest alignment boundary. Typically used with hardware RAID Logical Unit Number (LUN) arrays to improve performance. <n> is the number of kilobytes (KB) from the beginning of the disk to the closest alignment boundary. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To create an extended partition of 1000 megabytes in size, type:
create partition extended size=1000
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a logical partition on an existing extended partition. After the partition has been created, the focus automatically shifts to the new partition.
[!IMPORTANT] You can use this command only on Master Boot Record (MBR) disks. You must use the select disk command to select a basic MBR disk and shift the focus to it.
You must create an extended partition before you can create logical drives.
create partition logical [size=<n>] [offset=<n>] [align=<n>] [noerr]
Parameter | Description |
---|---|
size=<n> |
Specifies the size of the logical partition in megabytes (MB), which must be smaller than the extended partition. If no size is given, the partition continues until there is no more free space in the extended partition. |
offset=<n> |
Specifies the offset in kilobytes (KB), at which the partition is created. The offset rounds up to completely fill whatever cylinder size is used. If no offset is given, then the partition is placed in the first disk extent that is large enough to hold it. The partition is at least as long in bytes as the number specified by size=<n> . If you specify a size for the logical partition, it must be smaller than the extended partition. |
align=<n> |
Aligns all volume or partition extents to the closest alignment boundary. Typically used with hardware RAID Logical Unit Number (LUN) arrays to improve performance. <n> is the number of kilobytes (KB) from the beginning of the disk to the closest alignment boundary. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To create a logical partition of 1000 megabytes in size, in the extended partition of the selected disk, type:
create partition logical size=1000
Creates a partition or shadow on a disk, a volume on one or more disks, or a virtual hard disk (VHD). If you're using this command to create a volume on the shadow disk, you must already have at least one volume in the shadow copy set.
create partition
create volume
Parameter | Description |
---|---|
create partition primary command | Creates a primary partition on the basic disk with focus. |
create partition efi command | Creates an Extensible Firmware Interface (EFI) system partition on a GUID Partition Table (gpt) disk on Itanium-based computers. |
create partition extended command | Creates an extended partition on the disk with focus. |
create partition logical command | Creates a logical partition in an existing extended partition. |
create partition msr command | Creates a Microsoft Reserved (MSR) partition on a GUID partition table (gpt) disk. |
create volume simple command | Creates a simple volume on the specified dynamic disk. |
create volume mirror command | Creates a volume mirror by using the two specified dynamic disks. |
create volume raid command | Creates a RAID-5 volume using three or more specified dynamic disks. |
create volume stripe command | Creates a striped volume using two or more specified dynamic disks. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates an Extensible Firmware Interface (EFI) system partition on a GUID Partition Table (gpt) disk on Itanium-based computers. After the partition is created, the focus is given to the new partition.
[!NOTE] A gpt disk must be selected for this operation to succeed. Use the select disk command to select a disk and shift the focus to it.
create partition efi [size=<n>] [offset=<n>] [noerr]
Parameter | Description |
---|---|
size=<n> |
The size of the partition in megabytes (MB). If no size is given, the partition continues until there is no more free space in the current region. |
offset=<n> |
The offset in kilobytes (KB), at which the partition is created. If no offset is given, the partition is placed in the first disk extent that is large enough to hold it. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
You must add at least one volume with the add volume command before you can use the create command.
After you run the create command, you can use the exec command to run a duplication script for backup from the shadow copy.
You can use the begin backup command to specify a full backup, rather than a copy backup.
To create an EFI partition of 1000 megabytes on the selected disk, type:
create partition efi size=1000
Copies one or more files from one location to another.
[!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).
copy [/d] [/v] [/n] [/y | /-y] [/z] [/a | /b] <source> [/a | /b] [+<source> [/a | /b] [+ ...]] [<destination> [/a | /b]]
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. |
<source> |
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. |
<destination> |
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. |
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 /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 <source> +,,
Where the commas indicate that the destination parameter has been intentionally left out.
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
[!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
[!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
[!CAUTION] If you combine binary files, the resulting file might be unusable due to internal formatting.
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
Converts an empty basic disk with the master boot record (MBR) partition style into a basic disk with the GUID partition table (GPT) partition style. A basic MBR disk must be selected for this operation to succeed. Use the select disk command to select a basic disk and shift the focus to it.
[!IMPORTANT] The disk must be empty to convert it to a basic disk. Back up your data, and then delete all partitions or volumes before converting the disk. The required minimum disk size for conversion to GPT is 128 megabytes.
[!NOTE] For instructions regarding how to use this command, see Change a Master Boot Record Disk into a GUID Partition Table Disk.
convert gpt [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To convert a basic disc from MBR partition style to GPT partition style, type:
convert gpt
Converts an empty dynamic disk to a basic disk. A dynamic disk must be selected for this operation to succeed. Use the select disk command to select a dynamic disk and shift the focus to it.
[!IMPORTANT] The disk must be empty to convert it to a basic disk. Back up your data, and then delete all partitions or volumes before converting the disk.
[!NOTE] For instructions regarding how to use this command, see Change a Dynamic Disk Back to a Basic Disk).
convert basic [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To convert the selected dynamic disk to basic, type:
convert basic
Converts a disk from one disk type to another.
convert basic
convert dynamic
convert gpt
convert mbr
Parameter | Description |
---|---|
convert basic command | Converts an empty dynamic disk into a basic disk. |
convert dynamic command | Converts a basic disk into a dynamic disk. |
convert gpt command | Converts an empty basic disk with the master boot record (MBR) partition style into a basic disk with the GUID partition table (GPT) partition style. |
convert mbr command | Converts an empty basic disk with the GUID Partition Table (GPT) partition style into a basic disk with the master boot record (MBR) partition style. |
Displays the directory structure of a path or of the disk in a drive graphically. The structure displayed by this command depends upon the parameters that you specify at the command prompt. If you don't specify a drive or path, this command displays the tree structure beginning with the current directory of the current drive.
tree [<drive>:][<path>] [/f] [/a]
Parameter | Description |
---|---|
<drive>: |
Specifies the drive that contains the disk for which you want to display the directory structure. |
<path> |
Specifies the directory for which you want to display the directory structure. |
/f | Displays the names of the files in each directory. |
/a | Specifies to use text characters instead of graphic characters to show the lines that link subdirectories. |
/? | Displays help at the command prompt. |
To display the names of all the subdirectories on the disk in your current drive, type:
tree \
To display, one screen at a time, the files in all the directories on drive C, type:
tree c:\ /f | more
To print a list of all the directories on drive C, type:
tree c:\ /f prn
The tracerpt command parses Event Trace Logs, log files generated by Performance Monitor, and real-time Event Trace providers. It also generates dump files, report files, and report schemas.
tracerpt <[-l] <value [value [...]]>|-rt <session_name [session_name [...]]>> [options]
Parameters | Description | ||
---|---|---|---|
-config <filename> |
Specifies which settings file to load, which includes your command options. | ||
-y | Specifies to answer yes to all questions, without prompting. | ||
-f `<XML | HTML>` | Specifies the report file format. | |
-of `<CSV | EVTX | XML>` | Specifies the dump file format. The default is **XML*. |
-df <filename> |
Specifies to create a Microsoft-specific counting/reporting schema file. | ||
-int <filename> |
Specifies to dump the interpreted event structure to the specified file. | ||
-rts | Specifies to add the report raw timestamp in the event trace header. Can only be used with -o. It's not supported with -report or -summary. | ||
-tmf <filename> |
Specifies which Trace Message Format definition file to use. | ||
-tp <value> |
Specifies the TMF file search path. Multiple paths may be used, separated by a semicolon (;). | ||
-i <value> |
Specifies the provider image path. The matching PDB will be located in the Symbol Server. Multiple paths can be used, separated by a semicolon (;). | ||
-pdb <value> |
Specifies the symbol server path. Multiple paths can be used, separated by a semicolon (;). | ||
-gmt | Specifies to convert WPP payload timestamps to Greenwich Mean Time. | ||
-rl <value> |
Specifies the System Report Level from 1 to 5. Default is 1. | ||
-summary [filename] | Specifies to create a summary report text file. The filename, if not specified, is summary.txt. | ||
-o [filename] | Specifies to create a text output file. The filename, if not specified, is dumpfile.xml. | ||
-report [filename] | Specifies to create a text output report file. The filename, if not specified, is workload.xml. | ||
-lr | Specifies to be less restrictive. This uses best efforts for events that don't match the events schema. | ||
-export [filename] | Specifies to create an Event Schema export file. The filename, if not specified, is schema.man. | ||
[-l] <value [value […]]> |
Specifies the Event Trace log file to process. | ||
-rt <session_name [session_name […]]> |
Specifies the Real-time Event Trace Session data sources. | ||
-? | Displays help at the command prompt. |
To create a report based on the two event logs logfile1.etl and logfile2.etl, and to create the dump file logdump.xml in XML format, type:
tracerpt logfile1.etl logfile2.etl -o logdump.xml -of XML
To create a report based on the event log logfile.etl, to create the dump file logdmp.xml in XML format, to use best efforts to identify events not in the schema, and to produce a summary report file logdump.txt and a report file, logrpt.xml, type:
tracerpt logfile.etl -o logdmp.xml -of XML -lr -summary logdmp.txt -report logrpt.xml
To use the two event logs logfile1.etl and logfile2.etl to produce a dump file, and to report file with the default filenames, type:
tracerpt logfile1.etl logfile2.etl -o -report
To use the event log logfile.etl and the performance log counterfile.blg to produce the report file logrpt.xml and the Microsoft-specific XML schema file schema.xml, type:
tracerpt logfile.etl counterfile.blg -report logrpt.xml -df schema.xml
To read the real-time Event Trace Session NT Kernel Logger and to produce the dump file logfile.csv in CSV format, type:
tracerpt -rt NT Kernel Logger -o logfile.csv -of CSV
Displays or sets the system time. If used without parameters, time displays the current system time and prompts you to enter a new time.
[!NOTE] You must be an administrator to change the current time.
time [/t | [<HH>[:<MM>[:<SS>]] [am|pm]]]
Parameter | Description | |
---|---|---|
` |
pm]` | Sets the system time to the new time specified, where HH is in hours (required), MM is in minutes, and SS is in seconds. NN can be used to specify hundredths of a second. You must separate values for HH, MM, and SS with colons (:). SS and NN must be separated with a period (.). If am or pm isn't specified, time uses the 24-hour format by default. |
/t | Displays the current time without prompting you for a new time. | |
/? | Displays help at the command prompt. |
Valid HH values are 0 through 24.
Valid MM and SS values are 0 through 59.
If command extensions are enabled, to display the current system time, type:
time /t
To change the current system time to 5:30 PM, type either of the following:
time 17:30:00
time 5:30 pm
To display the current system time, followed by a prompt to enter a new time, type:
The current time is: 17:33:31.35
Enter the new time:
To keep the current time and return to the command prompt, press ENTER. To change the current time, type the new time and then press ENTER.
Pauses the command processor for the specified number of seconds. This command is typically used in batch files.
timeout /t <timeoutinseconds> [/nobreak]
Parameter | Description |
---|---|
/t <timeoutinseconds> |
Specifies the decimal number of seconds (between -1 and 99999) to wait before the command processor continues processing. The value -1 causes the computer to wait indefinitely for a keystroke. |
/nobreak | Specifies to ignore user key strokes. |
/? | Displays help at the command prompt. |
A user keystroke resumes the command processor execution immediately, even if the timeout period has not expired.
When used in conjunction with the resource kit's Sleep tool, timeout is similar to the pause command.
To pause the command processor for ten seconds, type:
timeout /t 10
To pause the command processor for 100 seconds and ignore any keystroke, type:
timeout /t 100 /nobreak
To pause the command processor indefinitely until a key is pressed, type:
timeout /t -1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Exits telnet.
q[uit]
To exit telnet, type:
q
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sends telnet commands to the telnet server.
sen {ao | ayt | brk | esc | ip | synch | <string>} [?]
Parameter | Description |
---|---|
ao | Sends the telnet command Abort Output. |
ayt | Sends the telnet command Are You There? |
brk | Sends the telnet command brk. |
esc | Sends the current telnet escape character. |
ip | Sends the telnet command Interrupt Process. |
synch | Sends the telnet command synch. |
<string> |
Sends whatever string you type to the telnet server. |
? | Displays help associated with this command. |
To send the Are you there? command to the telnet server, type:
sen ayt
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays operating parameters.
d[isplay]
To display operating parameters, type:
d
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Communicates with a computer running the telnet server service. Running this command without any parameters, lets you enter the telnet context, as indicated by the telnet prompt (Microsoft telnet>). From the telnet prompt, you can use telnet commands to manage the computer running the telnet client.
[!IMPORTANT] You must install the telnet client software before you can run this command. For more information, see Installing telnet.
telnet [/a] [/e <escapechar>] [/f <filename>] [/l <username>] [/t {vt100 | vt52 | ansi | vtnt}] [<host> [<port>]] [/?]
Parameter | Description | |||
---|---|---|---|---|
/a | Attempts automatic logon. Same as /l option, except that it uses the currently logged on user's name. | |||
/e <escapechar> |
Specifies the escape character used to enter the telnet client prompt. | |||
/f <filename> |
Specifies the file name used for client side logging. | |||
/l <username> |
Specifies the user name to log on with on the remote computer. | |||
/t `{vt100 | vt52 | ansi | vtnt}` | Specifies the terminal type. Supported terminal types are vt100, vt52, ansi, and vtnt. |
<host> [<port>] |
Specifies the hostname or IP address of the remote computer to connect to, and optionally the TCP port to use (default is TCP port 23). | |||
/? | Displays help at the command prompt. |
To use telnet to connect to the computer running the telnet Server Service at telnet.microsoft.com, type:
telnet telnet.microsoft.com
To use telnet to connect to the computer running the telnet Server Service at telnet.microsoft.com on TCP port 44 and to log the session activity in a local file called telnetlog.txt, type:
telnet /f telnetlog.txt telnet.microsoft.com 44
Sets up or disables the TAPI client. For TAPI to function correctly, you must run this command to specify the remote servers that will be used by TAPI clients.
[!IMPORTANT] To use this command, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.
tcmsetup [/q] [/x] /c <server1> [<server2> …]
tcmsetup [/q] /c /d
Parameter | Description |
---|---|
/q | Prevents the display of message boxes. |
/x | Specifies that connection-oriented callbacks will be used for heavy traffic networks where packet loss is high. When this parameter is omitted, connectionless callbacks will be used. |
/c | Required. Specifies client setup. |
<server1> |
Required. Specifies the name of the remote server that has the TAPI service providers that the client will use. The client will use the service providers' lines and phones. The client must be in the same domain as the server or in a domain that has a two-way trust relationship with the domain that contains the server. |
<server2>… |
Specifies any additional server or servers that will be available to this client. If you specify a list of servers is, use a space to separate the server names. |
/d | Clears the list of remote servers. Disables the TAPI client by preventing it from using the TAPI service providers that are on the remote servers. |
/? | Displays help at the command prompt. |
Before a client user can use a phone or line on a TAPI server, the telephony server administrator must assign the user to the phone or line.
The list of telephony servers that is created by this command replaces any existing list of telephony servers available to the client. You can't use this command to add to the existing list.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Ends one or more tasks or processes. Processes can be ended by process ID or image name. You can use the tasklist command command to determine the process ID (PID) for the process to be ended.
[!NOTE] This command replaces the kill tool.
taskkill [/s <computer> [/u [<domain>\]<username> [/p [<password>]]]] {[/fi <filter>] [...] [/pid <processID> | /im <imagename>]} [/f] [/t]
Parameter | Description |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer. |
/u <domain>\<username> |
Runs the command with the account permissions of the user who is specified by <username> or by <domain>\<username> . The /u parameter can be specified only if /s is also specified. The default is the permissions of the user who is currently logged on to the computer that is issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
/fi <filter> |
Applies a filter to select a set of tasks. You can use more than one filter or use the wildcard character (* ) to specify all tasks or image names. The valid filters are listed in the Filter names, operators, and values section of this article. |
/pid <processID> |
Specifies the process ID of the process to be terminated. |
/im <imagename> |
Specifies the image name of the process to be terminated. Use the wildcard character (* ) to specify all image names. |
/f | Specifies that processes be forcefully ended. This parameter is ignored for remote processes; all remote processes are forcefully ended. |
/t | Ends the specified process and any child processes started by it. |
Filter Name | Valid Operators | Valid Value(s) | ||
---|---|---|---|---|
STATUS | eq, ne | `RUNNING | NOT RESPONDING | UNKNOWN` |
IMAGENAME | eq, ne | Image name | ||
PID | eq, ne, gt, lt, ge, le | PID value | ||
SESSION | eq, ne, gt, lt, ge, le | Session number | ||
CPUtime | eq, ne, gt, lt, ge, le | CPU time in the format HH:MM:SS, where MM and SS are between 0 and 59 and HH is any unsigned number | ||
MEMUSAGE | eq, ne, gt, lt, ge, le | Memory usage in KB | ||
USERNAME | eq, ne | Any valid user name (<user> or <domain\user> ) |
||
SERVICES | eq, ne | Service name | ||
WINDOWTITLE | eq, ne | Window title | ||
MODULES | eq, ne | DLL name |
The WINDOWTITLE and STATUS filters aren't supported when a remote system is specified.
The wildcard character (*
) is accepted for the */im
option, only when a filter is applied.
Ending a remote process is always carried out forcefully, regardless whether the /f option is specified.
Providing a computer name to the hostname filter causes a shutdown, stopping all processes.
To end the processes with process IDs 1230, 1241, and 1253, type:
taskkill /pid 1230 /pid 1241 /pid 1253
To forcefully end the process Notepad.exe if it was started by the system, type:
taskkill /f /fi "USERNAME eq NT AUTHORITY\SYSTEM" /im notepad.exe
To end all processes on the remote computer Srvmain with an image name beginning with note, while using the credentials for the user account Hiropln, type:
taskkill /s srvmain /u maindom\hiropln /p p@ssW23 /fi "IMAGENAME eq note*" /im *
To end the process with the process ID 2134 and any child processes that it started, but only if those processes were started by the Administrator account, type:
taskkill /pid 2134 /t /fi "username eq administrator"
To end all processes that have a process ID greater than or equal to 1000, regardless of their image names, type:
taskkill /f /fi "PID ge 1000" /im *
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Removes a service connection point for a TAPI application directory partition.
tapicfg removescp /directory:<partitionname> [/domain:<domainname>]
Parameter | Description |
---|---|
removescp /directory:<partitionname> |
Required. Specifies the DNS name of the TAPI application directory partition for which a service connection point is removed. |
/domain: <domainname> |
Specifies the DNS name of the domain from which the service connection point is removed. If the domain name isn't specified, the name of the local domain is used. |
/? | Displays help at the command prompt. |
This command-line tool can be run on any computer that is a member of the domain.
User-supplied text (such as the names of TAPI application directory partitions, servers, and domains) with International or Unicode characters are only displayed correctly if appropriate fonts and language support are installed.
You can still use Internet Locator Service (ILS) servers in your organization, if ILS is needed to support certain applications, because TAPI clients running Windows XP or a Windows Server 2003 operating system can query either ILS servers or TAPI application directory partitions.
You can use tapicfg to create or remove service connection points. If the TAPI application directory partition is renamed for any reason (for example, if you rename the domain in which it resides), you must remove the existing service connection point and create a new one that contains the new DNS name of the TAPI application directory partition to be published. Otherwise, TAPI clients are unable to locate and access the TAPI application directory partition. You can also remove a service connection point for maintenance or security purposes (for example, if you do not want to expose TAPI data on a specific TAPI application directory partition).
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sets the default TAPI application directory partition for the domain.
tapicfg makedefault /directory:<partitionname> [/domain:<domainname>]
Parameter | Description |
---|---|
makedefault /directory:<partitionname> |
Required. Specifies the DNS name of the TAPI application directory partition set as the default partition for the domain. This name must be a fully-qualified domain name. |
/domain: <domainname> |
Specifies the DNS name of the domain for which the TAPI application directory partition is set as the default. If the domain name is not specified, the name of the local domain is used. |
/? | Displays help at the command prompt. |
This command-line tool can be run on any computer that is a member of the domain.
User-supplied text (such as the names of TAPI application directory partitions, servers, and domains) with International or Unicode characters are only displayed correctly if appropriate fonts and language support are installed.
You can still use Internet Locator Service (ILS) servers in your organization, if ILS is needed to support certain applications, because TAPI clients running Windows XP or a Windows Server 2003 operating system can query either ILS servers or TAPI application directory partitions.
You can use tapicfg to create or remove service connection points. If the TAPI application directory partition is renamed for any reason (for example, if you rename the domain in which it resides), you must remove the existing service connection point and create a new one that contains the new DNS name of the TAPI application directory partition to be published. Otherwise, TAPI clients are unable to locate and access the TAPI application directory partition. You can also remove a service connection point for maintenance or security purposes (for example, if you do not want to expose TAPI data on a specific TAPI application directory partition).
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a service connection point to publish a TAPI application directory partition.
tapicfg publishscp /directory:<partitionname> [/domain:<domainname>] [/forcedefault]
Parameter | Description |
---|---|
publishscp /directory:<partitionname> |
Required. Specifies the DNS name of the TAPI application directory partition that the service connection point will publish. |
/domain: <domainname> |
Specifies the DNS name of the domain in which the service connection point is created. If the domain name is not specified, the name of the local domain is used. |
/forcedefault | Specifies that this directory is the default TAPI application directory partition for the domain. There can be multiple TAPI application directory partitions in a domain. |
/? | Displays help at the command prompt. |
This command-line tool can be run on any computer that is a member of the domain.
User-supplied text (such as the names of TAPI application directory partitions, servers, and domains) with International or Unicode characters are only displayed correctly if appropriate fonts and language support are installed.
You can still use Internet Locator Service (ILS) servers in your organization, if ILS is needed to support certain applications, because TAPI clients running Windows XP or a Windows Server 2003 operating system can query either ILS servers or TAPI application directory partitions.
You can use tapicfg to create or remove service connection points. If the TAPI application directory partition is renamed for any reason (for example, if you rename the domain in which it resides), you must remove the existing service connection point and create a new one that contains the new DNS name of the TAPI application directory partition to be published. Otherwise, TAPI clients are unable to locate and access the TAPI application directory partition. You can also remove a service connection point for maintenance or security purposes (for example, if you do not want to expose TAPI data on a specific TAPI application directory partition).
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a TAPI application directory partition.
[!IMPORTANT] You must be a member of the Enterprise Admins group in active directory to run this command.
tapicfg install /directory:<partitionname> [/server:<DCname>] [/forcedefault]
Parameter | Description |
---|---|
install /directory:<partitionname> |
Required. Specifies the DNS name of the TAPI application directory partition to be created. This name must be a fully-qualified domain name. |
/server: <DCname> |
Specifies the DNS name of the domain controller on which the TAPI application directory partition is created. If the domain controller name isn't specified, the name of the local computer is used. |
/forcedefault | Specifies that this directory is the default TAPI application directory partition for the domain. There can be multiple TAPI application directory partitions in a domain. if this directory is the first TAPI application directory partition created on the domain, it's automatically set as the default, regardless of whether you use the /forcedefault option. |
/? | Displays help at the command prompt. |
This command-line tool can be run on any computer that is a member of the domain.
User-supplied text (such as the names of TAPI application directory partitions, servers, and domains) with International or Unicode characters are only displayed correctly if appropriate fonts and language support are installed.
You can still use Internet Locator Service (ILS) servers in your organization, if ILS is needed to support certain applications, because TAPI clients running Windows XP or a Windows Server 2003 operating system can query either ILS servers or TAPI application directory partitions.
You can use tapicfg to create or remove service connection points. If the TAPI application directory partition is renamed for any reason (for example, if you rename the domain in which it resides), you must remove the existing service connection point and create a new one that contains the new DNS name of the TAPI application directory partition to be published. Otherwise, TAPI clients are unable to locate and access the TAPI application directory partition. You can also remove a service connection point for maintenance or security purposes (for example, if you do not want to expose TAPI data on a specific TAPI application directory partition).
To create a TAPI application directory partition named tapifiction.testdom.microsoft.com on a server named testdc.testdom.microsoft.com, and then set it as the default TAPI application directory partition for the new domain, type:
tapicfg install /directory:tapifiction.testdom.microsoft.com /server:testdc.testdom.microsoft.com /forcedefault
The sysocmger command has been deprecated and isn't guaranteed to be supported in future releases of Windows.
Displays detailed configuration information about a computer and its operating system, including operating system configuration, security information, product ID, and hardware properties (such as RAM, disk space, and network cards).
systeminfo [/s <computer> [/u <domain>\<username> [/p <password>]]] [/fo {TABLE | LIST | CSV}] [/nh]
Parameter | Description |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer. |
/u <domain>\<username> |
Runs the command with the account permissions of the specified user account. If /u is not specified, this command uses the permissions of the user who is currently logged on to the computer that is issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
/fo <format> |
Specifies the output format with one of the following values:
|
/nh | Suppresses column headers in the output. Valid when the /fo parameter is set to TABLE or CSV. |
/? | Displays help at the command prompt. |
To view configuration information for a computer named Srvmain, type:
systeminfo /s srvmain
To remotely view configuration information for a computer named Srvmain2 that is located on the Maindom domain, type:
systeminfo /s srvmain2 /u maindom\hiropln
To remotely view configuration information (in list format) for a computer named Srvmain2 that is located on the Maindom domain, type:
systeminfo /s srvmain2 /u maindom\hiropln /p p@ssW23 /fo list
Reads input, sorts data, and writes the results to the screen, to a file, or to another device.
sort [/r] [/+<N>] [/m <kilobytes>] [/l <locale>] [/rec <characters>] [[<drive1>:][<path1>]<filename1>] [/t [<drive2>:][<path2>]] [/o [<drive3>:][<path3>]<filename3>]
Parameter | Description |
---|---|
/r | Reverses the sort order (that is, sorts from Z to A and from 9 to 0). |
/+<N> |
Specifies the character position number where sort will begin each comparison. N can be any valid integer. |
/m <kilobytes> |
Specifies the amount of main memory to use for the sort in kilobytes (KB). |
/l <locale> | Overrides the sort order of characters that are defined by the system default locale (that is, the language and Country/Region selected during installation). |
/rec <characters> |
Specifies the maximum number of characters in a record or a line of the input file (the default value is 4,096 and the maximum is 65,535). |
[<drive1>:][<path1>]<filename1> |
Specifies the file to be sorted. If no file name is specified, the standard input is sorted. Specifying the input file is faster than redirecting the same file as standard input. |
/t [<drive2>:][<path2>] |
Specifies the path of the directory to hold the sort command's working storage if the data does not fit in the main memory. By default, the system temporary directory is used. |
/o [<drive3>:][<path3>]<filename3> |
Specifies the file where the sorted input is to be stored. If not specified, the data is written to the standard output. Specifying the output file is faster than redirecting standard output to the same file. |
/unique | Only returns unique results. |
/? | Displays help at the command prompt. |
By default, comparisons start at the first character of each line. The /+ command-line option starts comparisons at the character that is specified by N. For example, /+3
indicates that each comparison should begin at the third character of each line. Lines with fewer than N characters collate before other lines.
The memory used is always a minimum of 160 KB. If the memory size is specified, the exact specified amount is used for the sort (must be at least 160 KB), regardless of how much main memory is available.
The default maximum memory size when no size is specified is 90% of the available main memory, if both the input and output are files, or 45% of main memory otherwise. The default setting usually gives the best performance.
Currently, the only alternative to the default locale is the C locale, which is faster than natural language sorting (it sorts characters according to their binary encodings).
You can use the pipe symbol (|
) to direct input data to the sort command from another command or to direct sorted output to another command. You can specify input and output files by using redirection symbols (<
or >
). It can be faster and more efficient (especially with large files) to specify the input file directly (as defined by filename1 in the command syntax), and then specify the output file using the /o parameter.
The sort command doesn't distinguish between uppercase and lowercase letters and has no limit on file size.
The sort program uses the collating-sequence table that corresponds to the Country/Region code and code-page settings. Characters greater than ASCII code 127 are sorted based on information in the Country.sys file or in an alternate file specified by the country command in your Config.nt file.
If the sort fits within the maximum memory size (as set by default or as specified by the /m parameter), the sort is performed in a single pass. Otherwise, the sort is performed in two separate sort and merge passes, and the amounts of memory used for both passes are equal. When two passes are performed, the partially sorted data is stored in a temporary file on disk. If there is not enough memory to perform the sort in two passes, a run-time error is issued. If the /m command-line option is used to specify more memory than is truly available, performance degradation or a run-time error can occur.
To sort and display, in reverse order, the lines in a file named expenses.txt, type:
sort /r expenses.txt
To search a large file named maillist.txt for the text Jones, and to sort the results of the search using the pipe (|
) to direct the output of a find command to the sort command, type:
find Jones maillist.txt | sort
The command produces a sorted list of lines that contain the specified text.
To sort keyboard input and display the results alphabetically on the screen, you can first use the sort command with no parameters, by typing:
sort
Then type the text that you want sorted, and press ENTER at the end of each line. When you have finished typing text, press CTRL+Z, and then press ENTER. The sort command displays the text you typed, sorted alphabetically.
Sets the options for shadow copy creation. If used without parameters, set option displays help at the command prompt.
set option {[differential | plex] [transportable] [[rollbackrecover] [txfrecover] | [noautorecover]]}
Parameter | Description |
---|---|
[differential] | Specifies to create a point-in-time snapshot of specified volumes. |
[plex] | Specifies to create a point-in-time clone copy of the data on a specified volume. |
[transportable] | Specifies that the shadow copy is not to be imported yet. The metadata .cab file can later be used to import the shadow copy to the same or a different computer. |
[rollbackrecover] | Signals writers to use autorecover during the PostSnapshot event. This is useful if the shadow copy will be used for rollback (for example, with data mining). |
[txfrecover] | Requests VSS to make the shadow copy transactionally consistent during creation. |
[noautorecover] | Stops writers and the file system from performing any recovery changes to the shadow copy to a transactionally consistent state. Noautorecover can't be used with txfrecover or rollbackrecover. |
Displays, sets, or removes cmd.exe environment variables. If used without parameters, set displays the current environment variable settings.
[!NOTE] This command requires command extensions, which are enabled by default.
The set command can also run from the Windows Recovery Console, using different parameters. For more information, see Windows Recovery Environment (WinRE).
set [<variable>=[<string>]]
set [/p] <variable>=[<promptString>]
set /a <variable>=<expression>
Parameter | Description |
---|---|
<variable> |
Specifies the environment variable to set or modify. |
<string> |
Specifies the string to associate with the specified environment variable. |
/p | Sets the value of <variable> to a line of input entered by the user. |
<promptstring> |
Specifies a message to prompt the user for input. This parameter must be used with the /p parameter. |
/a | Sets <string> to a numerical expression that is evaluated. |
<expression> |
Specifies a numerical expression. |
/? | Displays help at the command prompt. |
If command extensions are enabled (the default) and you run set with a value, it displays all of the variables that begin with that value.
The characters <
, >
, |
, &
, and ^
are special command shell characters, and they must be preceded by the escape character (^
) or enclosed in quotation marks when used in <string>
(for example, "StringContaining&Symbol"). If you use quotation marks to enclose a string that contains one of the special characters, the quotation marks are set as part of the environment variable value.
Use environment variables to control the behavior of some batch files and programs and to control the way Windows and the MS-DOS subsystem appears and works. The set command is often used in the Autoexec.nt file to set environment variables.
If you use the set command without any parameters, the current environment settings are displayed. These settings usually include the COMSPEC and PATH environment variables, which are used to help find programs on disk. Two other environment variables used by Windows are PROMPT and DIRCMD.
If you specify values for <variable>
and <string>
, the specified <variable>
value is added to the environment and <string>
is associated with that variable. If the variable already exists in the environment, the new string value replaces the old string value.
If you specify only a variable and an equal sign (without <string>
) for the set command, the <string>
value associated with the variable is cleared (as if the variable is not there).
If you use the /a parameter, the following operators are supported, in descending order of precedence:
| Operator | Operation performed |
|--|--|
| ( )
| Grouping |
| ! ~ -
| Unary |
| * / %
| Arithmetic |
| + -
| Arithmetic |
| << >>
| Logical shift |
| &
| Bitwise AND |
| ^
| Bitwise exclusive OR |
| = *= /= %= += -= &= ^=
| = <<= >>=
|
| ,
| Expression separator |
If you use logical (&&
or ||
) or modulus (%) operators, enclose the expression string in quotation marks. Any non-numeric strings in the expression are considered environment variable names, and their values are converted to numbers before they are processed. If you specify an environment variable name that is not defined in the current environment, a value of zero is allotted, which allows you to perform arithmetic with environment variable values without using the % to retrieve a value.
If you run set /a from the command line outside of a command script, it displays the final value of the expression.
Numeric values are decimal numbers unless prefixed by 0× for hexadecimal numbers or 0 for octal numbers. Therefore, 0×12 is the same as 18, which is the same as 022.
Delayed environment variable expansion support is disabled by default, but you can enable or disable it by using cmd /v.
When creating batch files, you can use set to create variables, and then use them in the same way that you would use the numbered variables %0 through %9. You can also use the variables %0 through %9 as input for set.
If you call a variable value from a batch file, enclose the value with percent signs (%). For example, if your batch program creates an environment variable named BAUD, you can use the string associated with BAUD as a replaceable parameter by typing %baud% at the command prompt.
To set the value TEST1 for the environment variable named testVar
, type:
set testVar=test^^1
The set command assigns everything that follows the equal sign (=) to the value of the variable. Therefore, if you type set testVar=test^1
, you'll get the following result, testVar=test1
.
To set the value TEST&1 for the environment variable testVar
, type:
set testVar=test^&1
To set an environment variable named INCLUDE so the string c:\directory is associated with it, type:
set include=c:\directory
You can then use the string c:\directory in batch files by enclosing the name INCLUDE with percent signs (%). For example, you can use dir %include%
in a batch file to display the contents of the directory associated with the INCLUDE environment variable. After this command is processed, the string c:\directory replaces %include%.
To use the set command in a batch program to add a new directory to the PATH environment variable, type:
@echo off
rem ADDPATH.BAT adds a new directory
rem to the path environment variable.
set path=%1;%path%
set
To display a list of all of the environment variables that begin with the letter P, type:
set p
Sets the context for shadow copy creation. If used without parameters, set context displays help at the command prompt.
set context {clientaccessible | persistent [nowriters] | volatile [nowriters]}
Parameter | Description |
---|---|
clientaccessible | Specifies that the shadow copy is usable by client versions of Windows. This context is persistent by default. |
persistent | Specifies that the shadow copy persists across program exit, reset, or restart. |
volatile | Deletes the shadow copy on exit or reset. |
nowriters | Specifies that all writers are excluded. |
To prevent shadow copies from being deleted when you exit DiskShadow, type:
set context persistent
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. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Allows you to turn on error reporting.
serverweroptin [/query] [/detailed] [/summary]
Parameter | Description |
---|---|
/query | Verifies your current setting. |
/detailed | Specifies to send detailed reports automatically. |
/summary | Specifies to send summary reports automatically. |
/? | Displays help at the command prompt. |
To verify the current setting, type:
serverweroptin /query
To automatically send detailed reports, type:
serverweroptin /detailed
To automatically send summary reports, type:
serverweroptin /summary
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Selects the specified virtual hard disk (VHD) and shifts the focus to it.
select vdisk file=<full path> [noerr]
Parameter | Description |
---|---|
file=<full path> |
Specifies the full path and file name of an existing VHD file. |
noerr | Used for scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To shift the focus to the VHD named c:\test\test.vhd, type:
select vdisk file=c:\test\test.vhd
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Selects the specified volume and shifts the focus to it. This command can also be used to display the volume that currently has the focus in the selected disk.
select volume={<n>|<d>}
Parameter | Description |
---|---|
<n> |
The number of the volume to receive the focus. You can view the numbers for all volumes on the disk currently selected by using the list volume command in DiskPart. |
<d> |
The drive letter or mount point path of the volume to receive the focus. |
If no volume is specified, this command displays the volume that currently has the focus in the selected disk.
On a basic disk, selecting a volume also gives the focus to the corresponding partition.
If a volume is selected with a corresponding partition, the partition will be automatically selected.
If a partition is selected with a corresponding volume, the volume will be automatically selected.
To shift the focus to volume 2, type:
select volume=2
To shift the focus to Drive C, type:
select volume=c
To shift the focus to the volume mounted on a folder named c:\mountpath, type:
select volume=c:\mountpath
To display the volume that currently has the focus in the selected disk, type:
select volume
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Selects the specified disk and shifts the focus to it.
select disk={<n>|<disk path>|system|next}
Parameter | Description |
---|---|
<n> |
Specifies the number of the disk to receive focus. You can view the numbers for all the disks on the computer by using the list disk command in DiskPart. NOTE |
<disk path> |
Specifies the location of the disk to receive focus, for example, PCIROOT(0)#PCI(0F02)#atA(C00T00L00) . To view the location path of a disk, select it and then type detail disk. |
system | On BIOS computers, this option specifies that disk 0 receives focus. On EFI computers, the disk containing the EFI system partition (ESP), used for the current boot, receives focus. On EFI computers, the command will fail if there's no ESP, if there's more than one ESP, or if the computer is booted from Windows Preinstallation Environment (Windows PE). |
next | After a disk is selected, this option iterates over all disks in the disk list. When you run this option, the next disk in the list receives focus. |
To shift the focus to disk 1, type:
select disk=1
To select a disk by using its location path, type:
select disk=PCIROOT(0)#PCI(0100)#atA(C00T00L01)
To shift the focus to the system disk, type:
select disk=system
To shift the focus to the next disk on the computer, type:
select disk=next
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2012 R2 and Windows Server 2012
Transforms a security policy file generated by using the Security Configuration Wizard (SCW) into a new Group Policy Object (GPO) in Active Directory Domain Services. The transform operation does not change any settings on the server where it is performed. After the transform operation has completed, an administrator must link the GPO to the desired OUs to deploy the policy to servers.
[!IMPORTANT] Domain administrator credentials are needed to complete the transform operation.
Internet Information Services (IIS) security policy settings can't be deployed by using Group Policy.
Firewall policies that list approved apps shouldn't be deployed to servers unless the Windows Firewall service started automatically when the server was last started.
scwcmd transform /p:<policyfile.xml> /g:<GPOdisplayname>
Parameter | Description |
---|---|
/p:<policyfile.xml> |
Specifies the path and file name of the .xml policy file that should be applied. This parameter must be specified. |
/g:<GPOdisplayname> |
Specifies the display name of the GPO. This parameter must be specified. |
/? | Displays help at the command prompt. |
To create a GPO named FileServerSecurity from a file named FileServerPolicy.xml, type:
scwcmd transform /p:FileServerPolicy.xml /g:FileServerSecurity
Creates a subkey and entries for a service in the registry and in the Service Control Manager database.
sc.exe [<servername>] create [<servicename>] [type= {own | share | kernel | filesys | rec | interact type= {own | share}}] [start= {boot | system | auto | demand | disabled | delayed-auto}] [error= {normal | severe | critical | ignore}] [binpath= <binarypathname>] [group= <loadordergroup>] [tag= {yes | no}] [depend= <dependencies>] [obj= {<accountname> | <objectname>}] [displayname= <displayname>] [password= <password>]
Parameter | Description | ||||||
---|---|---|---|---|---|---|---|
<servername> |
Specifies the name of the remote server on which the service is located. The name must use the Universal Naming Convention (UNC) format (for example, \myserver). To run SC.exe locally, don't use this parameter. | ||||||
<servicename> |
Specifies the service name returned by the getkeyname operation. | ||||||
`type= {own | share | kernel | filesys | rec | interact type= {own | share}}` | Specifies the service type. The options include:
|
`start= {boot | system | auto | demand | disabled | delayed-auto}` | Specifies the start type for the service. The options include:
|
|
`error= {normal | severe | critical | ignore}` | Specifies the severity of the error if the service fails to start when the computer is started. The options include:
|
|||
binpath= <binarypathname> |
Specifies a path to the service binary file. There is no default for binpath=, and this string must be supplied. | ||||||
group= <loadordergroup> |
Specifies the name of the group of which this service is a member. The list of groups is stored in the registry, in the HKLM\System\CurrentControlSet\Control\ServiceGroupOrder subkey. The default value is null. | ||||||
`tag= {yes | no}` | Specifies whether or not to obtain a TagID from the CreateService call. Tags are used only for boot-start and system-start drivers. | |||||
depend= <dependencies> |
Specifies the names of services or groups that must start before this service. The names are separated by forward slashes (/). | ||||||
`obj= { |
|
Specifies a name of an account in which a service will run, or specifies a name of the Windows driver object in which the driver will run. The default setting is LocalSystem. | |||||
displayname= <displayname> |
Specifies a friendly name for identifying the service in user interface programs. For example, the subkey name of one particular service is wuauserv, which has a more friendly display name of Automatic Updates. | ||||||
password= <password> |
Specifies a password. This is required if an account other than the LocalSystem account is used. | ||||||
/? | Displays help at the command prompt. |
Each command-line option (parameter) must include the equal sign as part of the option name.
A space is required between an option and its value (for example, type= own. If the space is omitted, the operation fails.
To create and register a new binary path for the NewService service, type:
sc.exe \\myserver create NewService binpath= c:\windows\system32\NewServ.exe
sc.exe create NewService binpath= c:\windows\system32\NewServ.exe type= share start= auto depend= +TDI NetBIOS
Resets DiskShadow.exe to the default state. This command is especially useful in separating compound DiskShadow operations, such as create, import, backup, or restore.
[!IMPORTANT After you run this command, you will lose state information from commands, such as add, set, load, or writer. This command also releases IVssBackupComponent interfaces and loses non-persistent shadow copies.
reset
Removes a drive letter or mount point from the volume with focus. If the all parameter is used, all current drive letters and mount points are removed. If no drive letter or mount point is specified, then DiskPart removes the first drive letter or mount point it encounters.
The remove command can also be used to change the drive letter associated with a removable drive. You can't remove the drive letters on system, boot, or paging volumes. In addition, you can't remove the drive letter for an OEM partition, any GPT partition with an unrecognized GUID, or any of the special, non-data, GPT partitions such as the EFI system partition.
[!NOTE] A volume must be selected for the remove command to succeed. Use the select volume command to select a disk and shift the focus to it.
remove [{letter=<drive> | mount=<path> [all]}] [noerr]
Parameter | Description |
---|---|
letter=<drive> |
The drive letter to remove. |
mount=<path> |
The mount point path to remove. |
all | Removes all current drive letters and mount points. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To remove the d: drive, type:
remove letter=d
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays status information.
st[atus]
To display status information, type:
st
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Reduces the physical size of a dynamically expanding virtual hard disk (VHD) file. This parameter is useful because dynamically expanding VHDs increase in size as you add files, but they do not automatically reduce in size when you delete files.
compact vdisk
A dynamically expanding VHD must be selected for this operation to succeed. Use the select vdisk command to select a VHD and shift the focus to it.
You can only use compact dynamically expanding VHDs that are detached or attached as read-only.
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 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 <serviceprofilefilename>.exe
file.
<serviceprofilefilename>.exe /q:a /c:cmstp.exe <serviceprofilefilename>.inf [/nf] [/s] [/u]
Syntax 2
cmstp.exe [/nf] [/s] [/u] [drive:][path]serviceprofilefilename.inf
Parameter | Description |
---|---|
<serviceprofilefilename>.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. |
[drive:][path] <serviceprofilefilename>.inf |
Required. Specifies, by name, the configuration file that 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. |
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
Clears the Command Prompt window.
cls
Parameter | Description |
---|---|
/? | Displays help at the command prompt. |
To clear all information that appears in the Command Prompt window and return to a blank window, type:
cls
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the install mode for the Remote Desktop Session Host server.
[!NOTE] This command has been replaced by the change user command. For more information, including the syntax and parameter details, see change user command.
Checks the file system and file system metadata of a volume for logical and physical errors. If used without parameters, chkdsk displays only the status of the volume and does not fix any errors. If used with the /f, /r, /x, or /b parameters, it fixes errors on the volume.
[!IMPORTANT] Membership in the local Administrators group, or equivalent, is the minimum required to run chkdsk. To open a command prompt window as an administrator, right-click Command prompt in the Start menu, and then click Run as administrator.
[!IMPORTANT] Interrupting chkdsk is not recommended. However, canceling or interrupting chkdsk should not leave the volume any more corrupt than it was before chkdsk was run. Running chkdsk again checks and should repair any remaining corruption on the volume.
[!NOTE] Chkdsk can be used only for local disks. The command cannot be used with a local drive letter that has been redirected over the network.
chkdsk [<volume>[[<path>]<filename>]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:<size>]] [/b]
Parameter | Description |
---|---|
<volume> |
Specifies the drive letter (followed by a colon), mount point, or volume name. |
[ [<path>]<filename> |
Use with file allocation table (FAT) and FAT32 only. Specifies the location and name of a file or set of files that you want chkdsk to check for fragmentation. You can use the ? and * wildcard characters to specify multiple files. |
/f | Fixes errors on the disk. The disk must be locked. If chkdsk cannot lock the drive, a message appears that asks you if you want to check the drive the next time you restart the computer. |
/v | Displays the name of each file in every directory as the disk is checked. |
/r | Locates bad sectors and recovers readable information. The disk must be locked. /r includes the functionality of /f, with the additional analysis of physical disk errors. |
/x | Forces the volume to dismount first, if necessary. All open handles to the drive are invalidated. /x also includes the functionality of /f. |
/i | Use with NTFS only. Performs a less vigorous check of index entries, which reduces the amount of time required to run chkdsk. |
/c | Use with NTFS only. Does not check cycles within the folder structure, which reduces the amount of time required to run chkdsk. |
/l[:<size> ] |
Use with NTFS only. Changes the log file size to the size you type. If you omit the size parameter, /l displays the current size. |
/b | Use with NTFS only. Clears the list of bad clusters on the volume and rescans all allocated and free clusters for errors. /b includes the functionality of /r. Use this parameter after imaging a volume to a new hard disk drive. |
/scan | Use with NTFS only. Runs an online scan on the volume. |
/forceofflinefix | Use with NTFS only (must be used with /scan). Bypass all online repair; all defects found are queued for offline repair (for example, chkdsk /spotfix ). |
/perf | Use with NTFS only (must be used with /scan). Uses more system resources to complete a scan as fast as possible. This may have a negative performance impact on other tasks running on the system. |
/spotfix | Use with NTFS only. Runs spot fixing on the volume. |
/sdcleanup | Use with NTFS only. Garbage collect unneeded security descriptor data (implies /f). |
/offlinescanandfix | Runs an offline scan and fix on the volume. |
/freeorphanedchains | Use with FAT/FAT32/exFAT only. Frees any orphaned cluster chains instead of recovering their contents. |
/markclean | Use with FAT/FAT32/exFAT only. Marks the volume clean if no corruption was detected, even if /f was not specified. |
/? | Displays help at the command prompt. |
The /i or /c switch reduces the amount of time required to run chkdsk by skipping certain volume checks.
If you want chkdsk to correct disk errors, you can't have open files on the drive. If files are open, the following error message appears:
Chkdsk cannot run because the volume is in use by another process. Would you like to schedule this volume to be checked the next time the system restarts? (Y/N)
If you choose to check the drive the next time you restart the computer, chkdsk checks the drive and corrects errors automatically when you restart the computer. If the drive partition is a boot partition, chkdsk automatically restarts the computer after it checks the drive.
You can also use the chkntfs /c
command to schedule the volume to be checked the next time the computer is restarted. Use the fsutil dirty set
command to set the volume's dirty bit (indicating corruption), so that Windows runs chkdsk when the computer is restarted.
You should use chkdsk occasionally on FAT and NTFS file systems to check for disk errors. Chkdsk examines disk space and disk use and provides a status report specific to each file system. The status report shows errors found in the file system. If you run chkdsk without the /f parameter on an active partition, it might report spurious errors because it cannot lock the drive.
Chkdsk corrects logical disk errors only if you specify the /f parameter. Chkdsk must be able to lock the drive to correct errors.
Because repairs on FAT file systems usually change a disk's file allocation table and sometimes cause a loss of data, chkdsk might display a confirmation message similar to the following:
10 lost allocation units found in 3 chains.
Convert lost chains to files?
If you press Y, Windows saves each lost chain in the root directory as a file with a name in the format File<nnnn>
.chk. When chkdsk finishes, you can check these files to see if they contain any data you need.
If you press N, Windows fixes the disk, but it does not save the contents of the lost allocation units.
If you don't use the /f parameter, chkdsk displays a message that the file needs to be fixed, but it does not fix any errors.
If you use chkdsk /f*
on a very large disk or a disk with a very large number of files (for example, millions of files), chkdsk /f
might take a long time to complete.
Use the /r parameter to find physical disk errors in the file system and attempt to recover data from any affected disk sectors.
If you specify the /f parameter, chkdsk displays an error message if there are open files on the disk. If you do not specify the /f parameter and open files exist, chkdsk might report lost allocation units on the disk. This could happen if open files have not yet been recorded in the file allocation table. If chkdsk reports the loss of a large number of allocation units, consider repairing the disk.
Because the Shadow Copies for Shared Folders source volume cannot be locked while Shadow Copies for Shared Folders is enabled, running chkdsk against the source volume might report false errors or cause chkdsk to unexpectedly quit. You can, however, check shadow copies for errors by running chkdsk in Read-only mode (without parameters) to check the Shadow Copies for Shared Folders storage volume.
The chkdsk command, with different parameters, is available from the Recovery Console.
On servers that are infrequently restarted, you may want to use the chkntfs or the fsutil dirty query
commands to determine whether the volume's dirty bit is already set before running chkdsk.
The following table lists the exit codes that chkdsk reports after it has finished.
| Exit code | Description | | --------- | ----------- | | 0 | No errors were found. | | 1 | Errors were found and fixed. | | 2 | Performed disk cleanup (such as garbage collection) or did not perform cleanup because /f was not specified. | | 3 | Could not check the disk, errors could not be fixed, or errors were not fixed because /f was not specified. |
To check the disk in drive D and have Windows fix errors, type:
chkdsk d: /f
If it encounters errors, chkdsk pauses and displays messages. Chkdsk finishes by displaying a report that lists the status of the disk. You cannot open any files on the specified drive until chkdsk finishes.
To check all files on a FAT disk in the current directory for noncontiguous blocks, type:
chkdsk *.*
Chkdsk displays a status report, and then lists the files that match the file specifications that have noncontiguous blocks.
There are two methods that can be used to retrieve chkdsk log file(s) in Windows. View the methods described below:
To view logs with Event Viewer, navigate to the following:
Alternatively, press Win + R keys to bring up the run dialog box, type eventvwr.msc, and select OK.
There are two source types when retrieving logs in PowerShell, chkdsk and winnit. Run one of the two commands in PowerShell to view the most current chkdsk log:
get-winevent -FilterHashTable @{logname="Application"} | ?{$_.providername -match "chkdsk"} | fl timecreated, message
get-winevent -FilterHashTable @{logname="Application"} | ?{$_.providername -match "winnit"} | fl timecreated, message
To export the log to a specific location, the following can be added to the end of the command | out-file "$env:userprofile\location\filename.txt"
. Example:
get-winevent -FilterHashTable @{logname="Application"} | ?{$_.providername -match "chkdsk"} | fl timecreated, message | out-file "C:\Users\Administrator\Desktop\Chkdsk_Log.txt"
get-winevent -FilterHashTable @{logname="Application"} | ?{$_.providername -match "winnit"} | fl timecreated, message | out-file "C:\Users\Administrator\Desktop\Chkdsk_Log.txt"
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Lists or changes the COM port mappings to be compatible with MS-DOS applications.
[!NOTE] This command has been replaced by the change port command. For more information, including the syntax and parameter details, see change port command.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Enables or disables logons from client sessions, or displays current logon status. This utility is useful for system maintenance. You must be an administrator to run this command.
[!NOTE] To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server.
change logon {/query | /enable | /disable | /drain | /drainuntilrestart}
Parameter | Description |
---|---|
/query | Displays the current logon status, whether enabled or disabled. |
/enable | Enables logons from client sessions, but not from the console. |
/disable | Disables subsequent logons from client sessions, but not from the console. Does not affect currently logged on users. |
/drain | Disables logons from new client sessions, but allows reconnections to existing sessions. |
/drainuntilrestart | Disables logons from new client sessions until the computer is restarted, but allows reconnections to existing sessions. |
/? | Displays help at the command prompt. |
Logons are re-enabled when you restart the system.
If you're connected to the Remote Desktop Session Host server from a client session, and then you disable logons and log off before re-enabling logons, you won't be able to reconnect to your session. To re-enable logons from client sessions, log on at the console.
change logon /query
change logon /enable
change logon /disable
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Lists or changes the COM port mappings to be compatible with MS-DOS applications.
[!NOTE] To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server.
change port [<portX>=<portY>| /d <portX> | /query]
Parameter | Description |
---|---|
<portX> =<portY> |
Maps COM <portX> to <portY> |
/d <portX> |
Deletes the mapping for COM <portX> |
/query | Displays the current port mappings. |
/? | Displays help at the command prompt. |
Most MS-DOS applications support only COM1 through COM4 serial ports. The change port command maps a serial port to a different port number, allowing apps that don't support high-numbered COM ports to access the serial port. Remapping works only for the current session and is not retained if you log off from a session and then log on again.
Use change port without any parameters to display the available COM ports and their current mappings.
change port com12=com1
change port /query
[!IMPORTANT] This command has been deprecated. Please use icacls instead.
Displays or modifies discretionary access control lists (DACL) on specified files.
cacls <filename> [/t] [/m] [/l] [/s[:sddl]] [/e] [/c] [/g user:<perm>] [/r user [...]] [/p user:<perm> [...]] [/d user [...]]
Parameter | Description |
---|---|
<filename> |
Required. Displays ACLs of specified files. |
/t | Changes ACLs of specified files in the current directory and all subdirectories. |
/m | Changes ACLs of volumes mounted to a directory. |
/l | Works on the Symbolic Link itself instead of the target. |
/s:sddl | Replaces the ACLs with those specified in the SDDL string. This parameter is not valid for use with the /e, /g, /r, /p, or /d parameters. |
/e | Edit an ACL instead of replacing it. |
/c | Continue after access denied errors. |
/g user:<perm> |
Grants specified user access rights, including these valid values for permission:
|
/r user [...] | Revoke specified user's access rights. Only valid when used with the /e parameter. |
[/p user:<perm> [...] |
Replace specified user's access rights, including these valid values for permission:
|
[/d user [...] | Deny specified user access. |
/? | Displays help at the command prompt. |
Output | Access control entry (ACE) applies to |
---|---|
OI | Object inherit. This folder and files. |
CI | Container inherit. This folder and subfolders. |
IO | Inherit only. The ACE does not apply to the current file/directory. |
No output message | This folder only. |
(OI)(CI) | This folder, subfolders, and files. |
(OI)(CI)(IO) | Subfolders and files only. |
(CI)(IO) | Subfolders only. |
(OI)(IO) | Files only. |
You can use wildcards (? and *) to specify multiple files.
You can specify more than one user.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Removes operating system load options for a specified operating system entry.
bootcfg /rmsw [/s <computer> [/u <domain>\<user> /p <password>]] [/mm] [/bv] [/so] [/ng] /id <osentrylinenum>
Parameter | Description |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (don't use backslashes). The default is the local computer. |
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by <user> or <domain>\<user> . The default is the permissions of the current logged on user on the computer issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
/mm | Removes the /maxmem option and its associated maximum memory value from the specified <osentrylinenum> . The /maxmem option specifies the maximum amount of RAM that the operating system can use. |
/bv | Removes the /basevideo option from the specified <osentrylinenum> . The /basevideo option directs the operating system to use standard VGA mode for the installed video driver. |
/so | Removes the /sos option from the specified <osentrylinenum> . The /sos option directs the operating system to display device driver names while they are being loaded. |
/ng | Removes the /noguiboot option from the specified <osentrylinenum> . The /noguiboot option disables the progress bar that appears before the CTRL+ALT+DEL logon prompt. |
/id <osentrylinenum> |
Specifies the operating system entry line number in the [operating systems] section of the Boot.ini file to which the operating system load options are added. The first line after the [operating systems] section header is 1. |
/? | Displays help at the command prompt. |
To use the bootcfg /rmsw command:
bootcfg /rmsw /mm 64 /id 2
bootcfg /rmsw /so /id 3
bootcfg /rmsw /so /ng /s srvmain /u hiropln /id 2
bootcfg /rmsw /ng /id 2
bootcfg /rmsw /mm 96 /ng /s srvmain /u maindom\hiropln /p p@ssW23 /id 2
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the operating system time-out value.
bootcfg /timeout <timeoutvalue> [/s <computer> [/u <domain>\<user> /p <password>]]
Parameter | Description |
---|---|
/timeout <timeoutvalue> |
Specifies the timeout value in the [boot loader] section. The <timeoutvalue> is the number of seconds the user has to select an operating system from the boot loader screen before NTLDR loads the default. The valid range for <timeoutvalue> is 0-999. If the value is 0, NTLDR immediately starts the default operating system without displaying the boot loader screen. |
/s <computer> |
Specifies the name or IP address of a remote computer (don't use backslashes). The default is the local computer. |
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by <user> or <domain>\<user> . The default is the permissions of the current logged on user on the computer issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
/? | Displays help at the command prompt. |
To use the bootcfg /timeout command:
bootcfg /timeout 30
bootcfg /s srvmain /u maindom\hiropln /p p@ssW23 /timeout 50
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Adds operating system load options specified as a string to an operating system entry in the [operating systems] section of the Boot.ini file. This command overwrites any existing operating system entry options.
bootcfg /raw [/s <computer> [/u <domain>\<user> /p <password>]] <osloadoptionsstring> [/id <osentrylinenum>] [/a]
Parameter | Description |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (don't use backslashes). The default is the local computer. |
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by <user> or <domain>\<user> . The default is the permissions of the current logged on user on the computer issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
<osloadoptionsstring> |
Specifies the operating system load options to add to the operating system entry. These load options replace any existing load options associated with the operating system entry. There is no validation against the <osloadoptions> parameter. |
/id <osentrylinenum> |
Specifies the operating system entry line number in the [operating systems] section of the Boot.ini file to which the operating system load options are added. The first line after the [operating systems] section header is 1. |
/a | Specifies which operating system options should be appended to any existing operating system options. |
/? | Displays help at the command prompt. |
This text should contain valid OS Load Options such as /debug, /fastdetect, /nodebug, /baudrate, /crashdebug, and /sos.
To add /debug /fastdetect to the end of the first operating system entry, replacing any previous operating system entry options:
bootcfg /raw /debug /fastdetect /id 1
To use the bootcfg /raw command:
bootcfg /raw /debug /sos /id 2
bootcfg /raw /s srvmain /u maindom\hiropln /p p@ssW23 /crashdebug /id 2
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Adds or changes the debug settings for a specified operating system entry.
[!NOTE] If you're attempting to debug port 1394, use the bootcfg dbg1394 command instead.
bootcfg /debug {on | off | edit}[/s <computer> [/u <domain>\<user> /p <password>]] [/port {COM1 | COM2 | COM3 | COM4}] [/baud {9600 | 19200 | 38400 | 57600 | 115200}] [/id <osentrylinenum>]
Parameter | Description | ||||
---|---|---|---|---|---|
`{on | off | edit}` | Specifies the value for port debugging, including:
|
||
/s <computer> |
Specifies the name or IP address of a remote computer (don't use backslashes). The default is the local computer. | ||||
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by <user> or <domain>\<user> . The default is the permissions of the current logged on user on the computer issuing the command. |
||||
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. | ||||
`/port {COM1 | COM2 | COM3 | COM4}` | Specifies the COM port to be used for debugging. Don't use this parameter if debugging is disabled. | |
`/baud {9600 | 19200 | 38400 | 57600 | 115200}` | Specifies the baud rate to be used for debugging. Don't use this parameter if debugging is disabled. |
/id <osentrylinenum> |
Specifies the operating system entry line number in the [operating systems] section of the Boot.ini file to which the operating system load options are added. The first line after the [operating systems] section header is 1. | ||||
/? | Displays help at the command prompt. |
To use the bootcfg /debug command:
bootcfg /debug on /port com1 /id 2
bootcfg /debug edit /port com2 /baud 19200 /id 2
bootcfg /s srvmain /u maindom\hiropln /p p@ssW23 /debug off /id 2
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Adds operating system load options for a specified operating system entry.
bootcfg /addsw [/s <computer> [/u <domain>\<user> /p <password>]] [/mm <maximumram>] [/bv] [/so] [/ng] /id <osentrylinenum>
Term | Definition |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (don't use backslashes). The default is the local computer. |
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by <user> or <domain>\<user> . The default is the permissions of the current logged on user on the computer issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
/mm <maximumram> |
Specifies the maximum amount of RAM, in megabytes, that the operating system can use. The value must be equal to or greater than 32 Megabytes. |
/bv | Adds the /basevideo option to the specified <osentrylinenum> , directing the operating system to use standard VGA mode for the installed video driver. |
/so | Adds the /sos option to the specified <osentrylinenum> , directing the operating system to display device driver names while they are being loaded. |
/ng | Adds the /noguiboot option to the specified <osentrylinenum> , disabling the progress bar that appears before the CTRL+ALT+DEL logon prompt. |
/id <osentrylinenum> |
Specifies the operating system entry line number in the [operating systems] section of the Boot.ini file to which the operating system load options are added. The first line after the [operating systems] section header is 1. |
/? | Displays help at the command prompt. |
To use the bootcfg /addsw command:
bootcfg /addsw /mm 64 /id 2
bootcfg /addsw /so /id 3
bootcfg /addsw /so /ng /s srvmain /u hiropln /id 2
bootcfg /addsw /ng /id 2
bootcfg /addsw /mm 96 /ng /s srvmain /u maindom\hiropln /p p@ssW23 /id 2
If BITS fails to start, this switch attempts to resolve errors related to incorrect service configuration and dependencies on Windows services (such as LANManworkstation) and the network directory. This switch also generates output that indicates if the issues that were resolved.
[!NOTE] This command isn't supported by BITS 1.5 and earlier.
bitsadmin /util /repairservice [/force]
Parameter | Description |
---|---|
/force | Optional. Deletes and creates the service again. |
[!NOTE] If BITS creates the service again, the service description string might be set to English even in a localized system.
To repair the BITS service configuration:
bitsadmin /util /repairservice
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Retrieves the proxy usage for the given service account. This command shows the value for each proxy usage, not just the proxy usage you specified for the service account. For details about setting the proxy usage for specific service accounts, see the bitsadmin util and setieproxy command.
bitsadmin /util /getieproxy <account> [/conn <connectionname>]
Parameter | Description |
---|---|
account | Specifies the service account whose proxy settings you want to retrieve. Possible values include:
|
connectionname | Optional. Used with the /conn parameter to specify which modem connection to use. If you don't specify the /conn parameter, BITS uses the LAN connection. |
To display the proxy usage for the NETWORK SERVICE account:
bitsadmin /util /getieproxy NETWORKSERVICE
Displays the command-line usage for the /util switches.
bitsadmin /util /help
To display the command-line help for the /util switches:
bitsadmin /util /help
Transfers one or more files. By default, the BITSAdmin service creates a download job that runs at NORMAL priority and updates the command window with progress information until the transfer is complete or until a critical error occurs,
The service completes the job if it successfully transfers all the files and cancels the job if a critical error occurs. The service does not create the job if it is unable to add files to the job or if you specify an invalid value for type or job_priority. To transfer more than one file, specify multiple <RemoteFileName>-<LocalFileName>
pairs. The pairs must be space-delimited.
[!NOTE] The BITSAdmin command continues to run if a transient error occurs. To end the command, press CTRL+C.
bitsadmin /transfer <name> [<type>] [/priority <job_priority>] [/ACLflags <flags>] [/DYNAMIC] <remotefilename> <localfilename>
Parameter | Description |
---|---|
name | The name of the job. This command can't be a GUID. |
type | Optional. Sets the type of job, including:
|
priority | Optional. Sets the priority of the job, including:
|
ACLflags | Optional. Indicates that you want to maintain the owner and ACL information with the file being downloaded. Specify one or more of the values, including:
|
/DYNAMIC | Configures the job using BITS_JOB_PROPERTY_DYNAMIC_CONTENT, which relaxes the server-side requirements. |
remotefilename | The name of the file after it's transferred to the server. |
localfilename | The name of the file that resides locally. |
To start a transfer job named myDownloadJob:
bitsadmin /transfer myDownloadJob http://prodserver/audio.wma c:\downloads\audio.wma
Sets the priority of the specified job.
bitsadmin /setpriority <job> <priority>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
priority | Sets the priority of the job, including:
|
To set the priority for the job named myDownloadJob to normal:
bitsadmin /setpriority myDownloadJob NORMAL
Sets the event notification flags for the specified job.
bitsadmin /setnotifyflags <job> <notifyflags>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
notifyflags | Can include one or more of the following notification flags, including:
|
To set the notification flags to generate an event when an error occurs, for a job named myDownloadJob:
bitsadmin /setnotifyflags myDownloadJob 2
Sets the command-line command that runs after the job finishes transferring data or after a job enters a specified state.
[!NOTE] This command isn't supported by BITS 1.2 and earlier.
bitsadmin /setnotifycmdline <job> <program_name> [program_parameters]
Parameter | Description |
---|---|
job | The job's display name or GUID. |
program_name | Name of the command to run when the job completes. You can set this value as NULL, but if you do, program_parameters must also be set to NULL. |
program_parameters | Parameters that you want to pass to program_name. You can set this value as NULL. If program_parameters isn't set to NULL, then the first parameter in program_parameters must match the program_name. |
To run Notepad.exe at the completion of the job named myDownloadJob:
bitsadmin /setnotifycmdline myDownloadJob c:\winnt\system32\notepad.exe NULL
To show the EULA text in Notepad.exe, at the completion of the job named myDownloadJob:
bitsadmin /setnotifycmdline myDownloadJob c:\winnt\system32\notepad.exe notepad c:\eula.txt
Sets the download timeout in seconds.
bitsadmin /setmaxdownloadtime <job> <timeout>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
timeout | The length for the download timeout, in seconds. |
To set the timeout for the job named myDownloadJob to 10 seconds.
bitsadmin /setmaxdownloadtime myDownloadJob 10
Sets the minimum length of time, in seconds, that BITS waits after encountering a transient error before trying to transfer the file.
bitsadmin /setminretrydelay <job> <retrydelay>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
retrydelay | Minimum length of time for BITS to wait after an error during transfer, in seconds. |
To set the minimum retry delay to 35 seconds for the job named myDownloadJob:
bitsadmin /setminretrydelay myDownloadJob 35
Sets the usage flags for a helper token that is associated with a BITS transfer job.
[!NOTE] This command isn't supported by BITS 3.0 and earlier.
bitsadmin /sethelpertokenflags <job> <flags>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
flags | Possible helper token values, including:
/setcredentialsjob targetscheme null null to send the credentials over HTTP. |
Sets the current command prompt's primary token (or an arbitrary local user account's token, if specified) as a BITS transfer job's helper token.
[!NOTE] This command isn't supported by BITS 3.0 and earlier.
bitsadmin /sethelpertoken <job> [<user_name@domain> <password>]
Parameter | Description |
---|---|
job | The job's display name or GUID. |
<username@domain> <password> |
Optional. The local user account credentials for which token to use. |
Add a custom HTTP header to a GET request sent to an HTTP server. For more information about GET requests, see Method Definitions and Header Field Definitions.
bitsadmin /setcustomheaders <job> <header1> <header2> <...>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
<header1> <header2> and so on |
The custom headers for the job. |
To add a custom HTTP header for the job named myDownloadJob:
bitsadmin /setcustomheaders myDownloadJob accept-encoding:deflate/gzip
Specifies the subject name of the client certificate to use for client authentication in an HTTPS (SSL) request.
bitsadmin /setclientcertificatebyname <job> <store_location> <store_name> <subject_name>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
store_location | Identifies the location of a system store to use for looking up the certificate. Possible values include:
|
store_name | The name of the certificate store. Possible values include:
|
subject_name | Name of the certificate. |
To specify the name of the client certificate myCertificate to use for client authentication in an HTTPS (SSL) request for the job named myDownloadJob:
bitsadmin /setclientcertificatebyname myDownloadJob 1 MY myCertificate
Cancels all jobs in the transfer queue owned by the current user. You can't reset jobs created by Local System. Instead, you must be an administrator and use the task scheduler to schedule this command as a task using the Local System credentials.
[!NOTE] If you have administrator privileges in BITSAdmin 1.5 and earlier, the /reset switch will cancel all the jobs in the queue. Additionally, the /allusers option isn't supported.
bitsadmin /reset [/allusers]
Parameter | Description |
---|---|
/allusers | Optional. Cancels all jobs in the queue owned by the current user. You must have administrator privileges to use this parameter. |
To cancel all the jobs in the transfer queue for the current user.
bitsadmin /reset
Removes credentials from a job.
[!NOTE] This command isn't supported by BITS 1.2 and earlier.
bitsadmin /removecredentials <job> <target> <scheme>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
target | Use either SERVER or PROXY. |
scheme | Use one of the following:
|
To remove credentials from the job named myDownloadJob:
bitsadmin /removecredentials myDownloadJob SERVER BASIC
Changes the remote URL for all files in the job from oldprefix to newprefix, as necessary.
bitsadmin /replaceremoteprefix <job> <oldprefix> <newprefix>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
oldprefix | Existing URL prefix. |
newprefix | New URL prefix. |
To change the remote URL for all files in job named myDownloadJob, from http://stageserver to http://prodserver.
bitsadmin /replaceremoteprefix myDownloadJob http://stageserver http://prodserver
Discovers peers again.
bitsadmin /peers /discover
To discover peers again:
bitsadmin /peers /discover
Sets the configuration flags that determine if the computer can serve content to peers and if it can download content from peers.
bitsadmin /peercaching /setconfigurationflags <job> <value>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
value | An unsigned integer with the following interpretation for the bits in the binary representation:
|
To specify the job's data to be downloaded from peers for the job named myDownloadJob:
bitsadmin /peercaching /setconfigurationflags myDownloadJob 1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Lists the available /peers switches.
Lists the available /peers switches.
bitsadmin /peers /help
bitsadmin /peers /discover
bitsadmin /peers /clear
bitsadmin /peers /list
Parameter | Description |
---|---|
bitsadmin peers and help | Displays the command-line usage for the /peers switches. |
bitsadmin peers and discover | Discovers peers again. |
bitsadmin peers and clear | Clears the peers list. |
bitsadmin peers and list | Lists all peers. |
Displays the command-line usage for the /peercaching switches.
bitsadmin /peercaching /help
To display the command-line help for the /peercaching switches:
bitsadmin /peercaching /help
Monitors jobs in the transfer queue that are owned by the current user.
bitsadmin /monitor [/allusers] [/refresh <seconds>]
Parameter | Description |
---|---|
/allusers | Optional. Monitors jobs for all users. You must have administrator privileges to use this parameter. |
/refresh | Optional. Refreshes the data at an interval specified by <seconds> . The default refresh interval is five seconds. To stop the refresh, press CTRL+C. |
To monitor the transfer queue for jobs owned by the current user and refreshes the information every 60 seconds.
bitsadmin /monitor /refresh 60
Lists the transfer jobs owned by the current user.
bitsadmin /list [/allusers][/verbose]
Parameter | Description |
---|---|
/allusers | Optional. Lists jobs for all users. You must have administrator privileges to use this parameter. |
/verbose | Optional. Provides detailed information about each job. |
To retrieve information about jobs owned by the current user.
bitsadmin /list
Retrieves the state of the specified job.
bitsadmin /getstate <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
The returned output values can be:
State | Description |
---|---|
Queued | The job is waiting to run. |
Connecting | BITS is contacting the server. |
Transferring | BITS is transferring data. |
Transferred | BITS has successfully transferred all files in the job. |
Suspended | The job is paused. |
Error | A non-recoverable error occurred; the transfer will not be retried. |
Transient_Error | A recoverable error occurred; the transfer retries when the minimum retry delay expires. |
Acknowledged | The job completed. |
Canceled | The job was canceled. |
To retrieve the state for the job named myDownloadJob:
bitsadmin /getstate myDownloadJob
Reports the temporary filename of the given file within the job.
bitsadmin /gettemporaryname <job> <file_index>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
file_index | Starts from 0. |
To report the temporary filename of file 2 for the job named myDownloadJob:
bitsadmin /gettemporaryname myDownloadJob 1
Gets the path of the file that contains the server upload-reply for the job.
[!NOTE] This command isn't supported by BITS 1.2 and earlier.
bitsadmin /getreplyfilename <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the upload-reply filename for the job named myDownloadJob:
bitsadmin /getreplyfilename myDownloadJob
Retrieves the proxy usage setting for the specified job.
bitsadmin /getproxyusage <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
The returned proxy usage values can be:
Preconfig - Use the owner's Internet Explorer defaults.
No_Proxy - Don't use a proxy server.
Override - Use an explicit proxy list.
Autodetect - Automatically detect the proxy settings.
To retrieve the proxy usage for the job named myDownloadJob:
bitsadmin /getproxyusage myDownloadJob
Retrieves the priority of the specified job.
bitsadmin /getpriority <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
The returned priority for this command can be:
FOREGROUND
HIGH
NORMAL
LOW
UNKNOWN
To retrieve the priority for the job named myDownloadJob:
bitsadmin /getpriority myDownloadJob
Retrieves the proxy bypass list for the specified job.
bitsadmin /getproxybypasslist <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
The bypass list contains the host names or IP addresses, or both, that are not to be routed through a proxy. The list can contain <local>
to refer to all servers on the same LAN. The list can be semicolon (;) or space-delimited.
To retrieve the proxy bypass list for the job named myDownloadJob:
bitsadmin /getproxybypasslist myDownloadJob
Retrieves the notification flags for the specified job.
bitsadmin /getnotifyflags <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
The job can contain one or more of the following notification flags:
Flag | Description |
---|---|
0x001 | Generate an event when all files in the job have been transferred. |
0x002 | Generate an event when an error occurs. |
0x004 | Disable notifications. |
0x008 | Generate an event when the job is modified or transfer progress is made. |
To retrieve the notify flags for the job named myDownloadJob:
bitsadmin /getnotifyflags myDownloadJob
Retrieves the length of time, in seconds, that the service will try to transfer the file after a transient error occurs.
bitsadmin /getnoprogresstimeout <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the progress time out value for the job named myDownloadJob:
bitsadmin /getnoprogresstimeout myDownloadJob
Retrieves the last time the job was modified or data was successfully transferred.
bitsadmin /getmodificationtime <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the last modified time for the job named myDownloadJob:
bitsadmin /getmodificationtime myDownloadJob
Gets the HTTP verb to use with the job.
bitsadmin /gethttpmethod <Job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the HTTP verb to use with the job named myDownloadJob:
bitsadmin /gethttpmethod myDownloadJob
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Retrieves the download timeout in seconds.
bitsadmin /getmaxdownloadtime <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To get the maximum download time for the job named myDownloadJob in seconds:
bitsadmin /getmaxdownloadtime myDownloadJob
Returns the SID of a BITS transfer job's helper token, if one is set.
[!NOTE] This command isn't supported by BITS 3.0 and earlier.
bitsadmin /gethelpertokensid <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the SID of a BITS transfer job named myDownloadJob:
bitsadmin /gethelpertokensid myDownloadJob
Retrieves the number of files in the specified job.
bitsadmin /getfilestotal <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the number of files included in the job named myDownloadJob:
bitsadmin /getfilestotal myDownloadJob
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Contains a list of the bitsadmin /cache switches.
Contains a list of the bitsadmin /cache switches.
bitsadmin /cache /help
bitsadmin /cache /clear
bitsadmin /cache /delete
bitsadmin /cache /deleteURL
bitsadmin /cache /list
bitsadmin /cache /info
bitsadmin /cache /getlimit
bitsadmin /cache /setlimit
bitsadmin /cache /getexpirationtime
bitsadmin /cache /setexpirationtime
Parameter | Description |
---|---|
bitsadmin cache and help | Displays the command-line usage for the /cache switches. |
bitsadmin cache and clear | Purges the local cache. |
bitsadmin cache and delete | Deletes a cache entry. |
bitsadmin cache and deleteURL | Deletes all cache entries for the given URL. |
bitsadmin cache and list | Lists all cache entries. |
bitsadmin cache and info | Dumps a specific cache entry. |
bitsadmin cache and getlimit | Retrieves the cache limit. |
bitsadmin cache and setlimit | Sets the cache limit. |
bitsadmin cache and getexpirationtime | Retrieves the cache expiration time. |
bitsadmin cache and setexpirationtime | Sets the cache expiration time. |
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.
auditpol /clear [/y]
Parameter | Description |
---|---|
/y | Suppresses the prompt to confirm if all audit policy settings should be cleared. |
/? | Displays help at the command prompt. |
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
[!NOTE] The preceding example is useful when using a script to perform this operation.
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.
auditpol command [<sub-command><options>]
Sub-command | Description |
---|---|
/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. |
/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. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays, sets, or clears the attributes of a volume.
attributes volume [{set | clear}] [{hidden | readonly | nodefaultdriveletter | shadowcopy}] [noerr]
Parameter | Description |
---|---|
set | Sets the specified attribute of the volume with focus. |
clear | Clears the specified attribute of the volume with focus. |
readonly | Specifies that the volume is read-only. |
hidden | Specifies that the volume is hidden. |
nodefaultdriveletter | Specifies that the volume does not receive a drive letter by default. |
shadowcopy | Specifies that the volume is a shadow copy volume. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
On basic master boot record (MBR) disks, the hidden, readonly, and nodefaultdriveletter parameters apply to all volumes on the disk.
On basic GUID partition table (GPT) disks, and on dynamic MBR and gpt disks, the hidden, readonly, and nodefaultdriveletter parameters apply only to the selected volume.
A volume must be selected for the attributes volume command to succeed. Use the select volume command to select a volume and shift the focus to it.
To display the current attributes on the selected volume, type:
attributes volume
To set the selected volume as hidden and read-only, type:
attributes volume set hidden readonly
To remove the hidden and read-only attributes on the selected volume, type:
attributes volume clear hidden readonly
Adds volumes to the Shadow Copy Set, which is the set of volumes to be shadow copied. When a shadow copy is created, an environment variable links the alias to the shadow ID, so the alias can then be used for scripting.
Volumes are added one at a time. Each time a volume is added, it's checked to make sure VSS supports shadow copy creation for that volume. This check can be invalidated by later use of the set context command.
This command is necessary to create shadow copies. If used without parameters, add volume displays help at the command prompt.
add volume <volume> [provider <providerid>]
Parameter | Description |
---|---|
<volume> |
Specifies a volume to add to the Shadow Copy Set. At least one volume is required for shadow copy creation. |
[provider \<providerid>] |
Specifies the Provider ID for a registered provider to use to create the shadow copy. If provider is not specified, the default provider is used. |
To view the current list of registered providers, at the diskshadow>
prompt, type:
list providers
The following output displays a single provider, which will be used by default:
* ProviderID: {b5946137-7b9f-4925-af80-51abd60b20d5}
Type: [1] VSS_PROV_SYSTEM
Name: Microsoft Software Shadow Copy provider 1.0
Version: 1.0.0.7
CLSID: {65ee1dba-8ff4-4a58-ac1c-3470ee2f376a}
1 provider registered.
To add drive C: to the Shadow Copy Set and assign an alias named System1, type:
add volume c: alias System1
Lists the items included in a specific backup.
To list the items included in a specific backup using this command, you must be a member of the Backup Operators group or the Administrators group, or you must have been delegated the appropriate permissions. In addition, you must run wbadmin from an elevated command prompt, by right-clicking Command Prompt, and then selecting Run as administrator.
wbadmin get items -version:<VersionIdentifier> [-backupTarget:{<BackupDestinationVolume> | <NetworkSharePath>}] [-machine:<BackupMachineName>]
Parameter | Description |
---|---|
-version | Specifies the version of the backup in MM/DD/YYYY-HH:MM format. If you don't know the version information, run the wbadmin get versions command. |
-backupTarget | Specifies the storage location that contains the backups for which you want the details. Use for listing backups stored at that target location. Backup target locations can be a locally attached disk drive or a remote shared folder. If this command is run on the same computer where the backup was created, this parameter isn't needed. However, this parameter is required to get information about a backup created from another computer. |
-machine | Specifies the name of the computer that you want the backup details for. Useful when multiple computers have been backed up to the same location. Should be used when -backupTarget is specified. |
To list items from the backup that was run on March 31, 2013 at 9:00 A.M., type:
wbadmin get items -version:03/31/2013-09:00
To list items from the backup of server01 that was run on April 30, 2013 at 9:00 A.M. and stored on \\<servername>\<share>
, type:
wbadmin get items -version:04/30/2013-09:00 -backupTarget:\\servername\share -machine:server01
Deletes the backup catalog that is stored on the local computer. Use this command when the backup catalog has been corrupted and you can't restore it using the wbadmin restore catalog command.
To delete a backup catalog using this command, you must be a member of the Backup Operators group or the Administrators group, or you must have been delegated the appropriate permissions. In addition, you must run wbadmin from an elevated command prompt, by right-clicking Command Prompt, and then selecting Run as administrator.
wbadmin delete catalog [-quiet]
Parameter | Description |
---|---|
-quiet | Runs the command without prompts to the user. |
If you delete the backup catalog of a computer, you'll no longer be able to get to any backups created for that computer using the Windows Server Backup snap-in. However, if you can get to another backup location and run the wbadmin restore catalog command, you can restore the backup catalog from that location.
We strongly recommend you create a new backup after you delete a backup catalog.
Applies to: Windows Server 2022, Windows Server 2019, Windows 10, Windows 8.1, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, Windows Server 2008
Deletes a specified volume's shadow copies. You can only delete shadow copies with the client-accessible type.
vssadmin delete shadows /for=<ForVolumeSpec> [/oldest | /all | /shadow=<ShadowID>] [/quiet]
Parameter | Description |
---|---|
/for=<ForVolumeSpec> |
Specifies which volume's shadow copy will be deleted. |
/oldest | Deletes only the oldest shadow copy. |
/all | Deletes all of the specified volume's shadow copies. |
/shadow=<ShadowID> |
Deletes the shadow copy specified by ShadowID. To get the shadow copy ID, use the vssadmin list shadows command. When you enter a shadow copy ID, use the following format, where each X represents a hexadecimal character: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX |
/quiet | Specifies that the command won't display messages while running. |
To delete the oldest shadow copy of volume C, type:
vssadmin delete shadows /for=c: /oldest
In the Windows Command shell, type is a built in command which displays the contents of a text file. Use the type command to view a text file without modifying it.
In PowerShell, type is a built-in alias to the Get-Content cmdlet, which also displays the contents of a file, but using a different syntax.
type [<drive>:][<path>]<filename>
Parameter | Description |
---|---|
[<drive>:][<path>]<filename> |
Specifies the location and name of the file or files that you want to view. If your <filename> contains spaces, you must enclose it in quotation marks (for example, "Filename Containing Spaces.txt"). You can also add multiple filenames by adding spaces between them. |
/? | Displays help at the command prompt. |
To display the contents of a file named holiday.mar, type:
type holiday.mar
To display the contents of a lengthy file named holiday.mar one screen at a time, type:
type holiday.mar | more
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Connects to another session on a Remote Desktop Session Host server.
[!IMPORTANT] You must have Full Control access permission or Connect special access permission to connect to another session.
[!NOTE] To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server.
tscon {<sessionID> | <sessionname>} [/dest:<sessionname>] [/password:<pw> | /password:*] [/v]
Parameter | Description |
---|---|
<sessionID> |
Specifies the ID of the session to which you want to connect. If you use the optional /dest:<sessionname> parameter, you can also specify the name of the current session. |
<sessionname> |
Specifies the name of the session to which you want to connect. |
/dest:<sessionname> |
Specifies the name of the current session. This session will disconnect when you connect to the new session. You can also use this parameter to connect the session of another user to a different session. |
/password:<pw> |
Specifies the password of the user who owns the session to which you want to connect. This password is required when the connecting user does not own the session. |
/password:* |
Prompts for the password of the user who owns the session to which you want to connect. |
/v | Displays information about the actions being performed. |
/? | Displays help at the command prompt. |
This command fails if you don't specify a password in the /password parameter, and the target session belongs to a user other than the current one.
You can't connect to the console session.
To connect to Session 12 on the current Remote Desktop Services Session Host server, and to disconnect the current session, type:
tscon 12
To connect to Session 23 on the current Remote Desktop Services Session Host server using the password mypass, and to disconnect the current session, type:
tscon 23 /password:mypass
To connect the session named TERM03 to the session named TERM05, and then to disconnect session TERM05, type:
tscon TERM03 /v /dest:TERM05
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sends files over an infrared link.
[!IMPORTANT] Make sure the devices intended to communicate over an infrared link have infrared functionality enabled and are working correctly. Also make sure an infrared link is established between the devices.
irftp [<drive>:\] [[<path>] <filename>] [/h][/s]
Parameter | Description |
---|---|
` |
Specifies the drive that contains the files that you want to send over an infrared link. |
[path]<filename> |
Specifies the location and name of the file or set of files that you want to send over an infrared link. If you specify a set of files, you must specify the full path for each file. |
/h | Specifies hidden mode. When hidden mode is used, the files are sent without displaying the Wireless Link dialog box. |
/s | Opens the Wireless Link dialog box, so that you can select the file or set of files that you want to send without using the command line to specify the drive, path, and file names. The Wireless Link dialog box also opens if you use this command without any parameters. |
To send c:\example.txt over the infrared link, type:
irftp c:\example.txt
Changes one or more of the following properties of a task:
The program that the task runs (/tr)
The user account under which the task runs (/ru)
The password for the user account (/rp)
Adds the interactive-only property to the task (/it)
To schedule, view, and change all tasks on the local computer, you must be a member of the Administrators group.
To schedule, view, and change all tasks on the remote computer, you must be a member of the Administrators group on the remote computer, or you must use the /u parameter to provide the credentials of an Administrator of the remote computer.
You can use the /u parameter in a /create or /change operation if the local and remote computers are in the same domain, or if the local computer is in a domain that the remote computer domain trusts. Otherwise, the remote computer can't authenticate the user account specified, and it can't verify that the account is a member of the Administrators group.
The task you plan to run must have the appropriate permission; these permissions vary by task. By default, tasks run with the permissions of the current user of the local computer, or with the permissions of the user specified by the /u parameter, if one is included. To run a task with permissions of a different user account or with system permissions, use the /ru parameter.
schtasks /change /tn <Taskname> [/s <computer> [/u [<domain>\]<user> [/p <password>]]] [/ru <username>] [/rp <password>] [/tr <Taskrun>] [/st <Starttime>] [/ri <interval>] [/rl <level>] [{/et <Endtime> | /du <duration>} [/k]] [/sd <Startdate>] [/ed <Enddate>] [/{ENABLE | DISABLE}] [/it] [/z]
Parameter | Description |
---|---|
/tn <Taskname> |
Identifies the task to be changed. Enter the task name (Note: Task names that have a space in its name are required to be wrapped in double quotes). |
/s <computer> |
Specifies the name or IP address of a remote computer (with or without backslashes). The default is the local computer. |
/u [<domain>] |
Runs this command with the permissions of the specified user account. By default, the command runs with the permissions of the current user of the local computer. The specified user account must be a member of the Administrators group on the remote computer. The /u and /p parameters are valid only when you use /s. |
/p <password> |
Specifies the password of the user account specified in the /u parameter. If you use the /u parameter without the /p parameter or the password argument, schtasks will prompt you for a password. The /u and /p parameters are valid only when you use /s. |
/ru <username> |
Changes the user name under which the scheduled task has to run. For the system account, valid values are "", "NT AUTHORITY\SYSTEM", or "SYSTEM". |
/rp <password> |
Specifies a new password for the existing user account, or the user account specified by the /ru parameter. This parameter is ignored with used with the local System account. |
/tr <Taskrun> |
Changes the program that the task runs. Enter the fully qualified path and file name of an executable file, script file, or batch file. If you don't add the path, schtasks assumes that the file is in the <systemroot>\System32 directory. The specified program replaces the original program run by the task. |
/st <Starttime> |
Specifies the start time for the task, using the 24-hour time format, HH:mm. For example, a value of 14:30 is equivalent to the 12-hour time of 2:30 PM. |
/ri <interval> |
Specifies the repetition interval for the scheduled task, in minutes. Valid range is 1 - 599940 (599940 minutes = 9999 hours). If either the /et or /du parameters are specified, the default is 10 minutes. |
/rl <level> |
Specifies the Run Level for the job. Acceptable values are LIMITED (scheduled tasks will be ran with the least level of privileges, such as Standard User accounts) and HIGHEST (scheduled tasks will be ran with the highest level of privileges, such as Superuser accounts). (Note: LIMITED is the default value). |
/et <Endtime> |
Specifies the end time for the task, using the 24-hour time format, HH:mm. For example, a value of 14:30 is equivalent to the 12-hour time of 2:30 PM. |
/du <duration> |
A value that specifies the duration to run the task. The time format is HH:mm (24-hour time). For example, a value of 14:30 is equivalent to the 12-hour time of 2:30 PM. |
/k | Stops the program that the task runs at the time specified by /et or /du. Without /k, schtasks doesn't start the program again after it reaches the time specified by /et or /du nor does it stop the program if it's still running. This parameter is optional and valid only with a MINUTE or HOURLY schedule. |
/sd <Startdate> |
Specifies the first date on which the task should be run. The date format is MM/DD/YYYY. |
/ed <Enddate> |
Specifies the last date on which the task should be run. The format is MM/DD/YYYY. |
/ENABLE | Specifies to enable the scheduled task. |
/DISABLE | Specifies to disable the scheduled task. |
/it | Specifies to run the scheduled task only when the run as user (the user account under which the task runs) is logged on to the computer. This parameter has no effect on tasks that run with system permissions or tasks that already have the interactive-only property set. You can't use a change command to remove the interactive-only property from a task. By default, run as user is the current user of the local computer when the task is scheduled or the account specified by the /u parameter, if one is used. However, if the command includes the /ru parameter, then the run as user is the account specified by the /ru parameter. |
/z | Specifies to delete the task upon the completion of its schedule. |
/? | Displays help at the command prompt. |
The /tn and /s parameters identify the task. The /tr, /ru, and /rp parameters specify properties of the task that you can change.
The /ru and /rp parameters specify the permissions under which the task runs. The /u and /p parameters specify the permissions used to change the task.
To change tasks on a remote computer, the user must be logged on to the local computer with an account that is a member of the Administrators group on the remote computer.
To run a /change command with the permissions of a different user (/u, /p), the local computer must be in the same domain as the remote computer or must be in a domain that the remote computer domain trusts.
The System account doesn't have interactive logon rights. Users don't see, and can't interact with, programs run with system permissions. To identify tasks with the /it property, use a verbose query (/query /v). In a verbose query display of a task with /it, the Logon Mode field has a value of Interactive only.
To change the program that the Virus Check task runs from VirusCheck.exe to VirusCheck2.exe, type:
schtasks /change /tn Virus Check /tr C:\VirusCheck2.exe
This command uses the /tn parameter to identify the task and the /tr parameter to specify the new program for the task. (You can't change the task name.)
To change the password of the user account for the RemindMe task on the remote computer, Svr01, type:
schtasks /change /tn RemindMe /s Svr01 /rp p@ssWord3
This procedure is required whenever the password for a user account expires or changes. If the password saved in a task is no longer valid, then the task doesn't run. The command uses the /tn parameter to identify the task and the /s parameter to specify the remote computer. It uses the /rp parameter to specify the new password, p@ssWord3.
To change the ChkNews task, which starts Notepad.exe every morning at 9:00 A.M., to start Internet Explorer instead, type:
schtasks /change /tn ChkNews /tr c:\program files\Internet Explorer\iexplore.exe /ru DomainX\Admin01
The command uses the /tn parameter to identify the task. It uses the /tr parameter to change the program that the task runs and the /ru parameter to change the user account under which the task runs. The /ru and /rp parameters, which provide the password for the user account, is not used. You must provide a password for the account, but you can use the /ru and /rp parameter and type the password in clear text, or wait for SchTasks.exe to prompt you for a password, and then enter the password in obscured text.
To change the SecurityScript task so that it runs with permissions of the System account, type:
schtasks /change /tn SecurityScript /ru
The command uses the /ru parameter to indicate the System account. Because tasks run with System account permissions do not require a password, SchTasks.exe does not prompt for one.
To add the interactive-only property to MyApp, an existing task, type:
schtasks /change /tn MyApp /it
This property assures that the task runs only when the run as user, that is, the user account under which the task runs, is logged on to the computer. The command uses the /tn parameter to identify the task and the /it parameter to add the interactive-only property to the task. Because the task already runs with the permissions of my user account, you don't need to change the /ru parameter for the task.
Imports a foreign disk group into the disk group of the local computer. This command imports every disk that is in the same group as the disk with focus.
[IMPORTANT] Before you can use this command, you must use the select disk command to select a dynamic disk in a foreign disk group and shift the focus to it.
import [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To import every disk that is in the same disk group as the disk with focus into the disk group of the local computer, type:
import
Deletes a service subkey from the registry. If the service is running or if another process has an open handle to the service, the service is marked for deletion.
[!NOTE] We don't recommend you to use this command to delete built-in operating system services such as DHCP, DNS, or Internet Information Services. To install, remove, or reconfigure operating system roles, services and components, see Install or Uninstall Roles, Role Services, or Features
sc.exe [<servername>] delete [<servicename>]
Parameter | Description |
---|---|
<servername> |
Specifies the name of the remote server on which the service is located. The name must use the Universal Naming Convention (UNC) format (for example, \myserver). To run SC.exe locally, don't use this parameter. |
<servicename> |
Specifies the service name returned by the getkeyname operation. |
/? | Displays help at the command prompt. |
To delete the service subkey NewServ from the registry on the local computer, type:
sc.exe delete NewServ
Imports a transportable shadow copy from a loaded metadata file into the system.
[IMPORTANT] Before you can use this command, you must use the load metadata command to load a DiskShadow metadata file.
import
The following is a sample DiskShadow script that demonstrates the use of the import command:
#Sample DiskShadow script demonstrating IMPORT
SET CONTEXT PERSISTENT
SET CONTEXT TRANSPORTABLE
SET METADATA transHWshadow_p.cab
#P: is the volume supported by the Hardware Shadow Copy provider
ADD VOLUME P:
CREATE
END BACKUP
#The (transportable) shadow copy is not in the system yet.
#You can reset or exit now if you wish.
LOAD METADATA transHWshadow_p.cab
IMPORT
#The shadow copy will now be loaded into the system.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays or sets the storage area network (san) policy for the operating system. If used without parameters, the current san policy is displayed.
san [policy={onlineAll | offlineAll | offlineShared}] [noerr]
Parameter | Description |
---|---|
policy={onlineAll|offlineAll|offlineShared}] | Sets the san policy for the currently booted operating system. The san policy determines whether a newly discovered disk is brought online or remains offline, and whether it becomes read/write or remains read-only. When a disk is offline, the disk layout can be read, but no volume devices are surfaced through Plug and Play. This means that no file system can be mounted on the disk. When a disk is online, one or more volume devices are installed for the disk. The following is an explanation of each parameter:
|
noerr | Used for scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To view the current policy, type:
san
To make all newly discovered disks, except the startup disk, offline and read-only by default, type:
san policy=offlineAll
Deletes a directory.
The rmdir command can also run from the Windows Recovery Console, using different parameters. For more information, see Windows Recovery Environment (WinRE).
[!NOTE] This command is the same as the rd command.
rmdir [<drive>:]<path> [/s [/q]]
Parameter | Description |
---|---|
[<drive>:]<path> |
Specifies the location and the name of the directory that you want to delete. Path is required. If you include a backslash () at the beginning of the specified path, then the path starts at the root directory (regardless of the current directory). |
/s | Deletes a directory tree (the specified directory and all its subdirectories, including all files). |
/q | Specifies quiet mode. Does not prompt for confirmation when deleting a directory tree. The /q parameter works only if /s is also specified. CAUTION: When you run in quiet mode, the entire directory tree is deleted without confirmation. Make sure that important files are moved or backed up before using the /q command-line option. |
/? | Displays help at the command prompt. |
You can't delete a directory that contains files, including hidden or system files. If you attempt to do so, the following message appears:
The directory is not empty
Use the dir /a command to list all files (including hidden and system files). Then use the attrib command with -h to remove hidden file attributes, -s to remove system file attributes, or -h -s to remove both hidden and system file attributes. After the hidden and file attributes have been removed, you can delete the files.
You can't use the rmdir command to delete the current directory. If you attempt to delete the current directory, the following error message appears:
The process can't access the file because it is being used by another process.
If you receive this error message, you must change to a different directory (not a subdirectory of the current directory), and then try again.
To change to the parent directory so you can safely remove the desired directory, type:
cd ..
To remove a directory named test (and all its subdirectories and files) from the current directory, type:
rmdir /s test
To run the previous example in quiet mode, type:
rmdir /s /q test
Loads and runs 32-bit dynamic-link libraries (DLLs). There are no configurable settings for Rundll32. Help information is provided for a specific DLL you run with the rundll32 command.
You must run the rundll32 command from an elevated command prompt. To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.
rundll32 <DLLname>
Parameter | Description |
---|---|
Rundll32 printui.dll,PrintUIEntry | Displays the printer user interface. |
Rundll32 can only call functions from a DLL explicitly written to be called by Rundll32.
Enables Windows operating systems to display an extended character set in graphics mode. If used without parameters, graftabl displays the previous and the current code page.
[!IMPORTANT] The graftabl command is a legacy command, and therefore outdated. It is normally not installed in modern Windows versions. Please see the chcp page for codepage handling.
graftabl <codepage>
graftabl /status
Parameter | Description |
---|---|
<codepage> |
Specifies a code page to define the appearance of extended characters in graphics mode. Valid code page identification numbers are:
|
/status | Displays the current code page being used by this command. |
/? | Displays help at the command prompt. |
The graftabl command affects only the monitor display of extended characters of the code page that you specify. It doesn't change the actual console input code page. To change the console input code page, use the mode or chcp command.
Each exit code and a brief description of it:
| Exit code | Description | | --------- | ----------- | | 0 | Character set was loaded successfully. No previous code page was loaded. | | 1 | An incorrect parameter was specified. No action was taken. | | 2 | A file error occurred. |
You can use the ERRORLEVEL environment variable in a batch program to process exit codes that are returned by graftabl.
To view the current code page used by graftabl, type:
graftabl /status
To load the graphics character set for code page 437 (United States) into memory, type:
graftabl 437
To load the graphics character set for code page 850 (multilingual) into memory, type:
graftabl 850
Directs cmd.exe to a labeled line in a batch program. Within a batch program, this command directs command processing to a line that is identified by a label. When the label is found, processing continues starting with the commands that begin on the next line.
goto <label>
Parameter | Description |
---|---|
<label> |
Specifies a text string that is used as a label in the batch program. |
/? | Displays help at the command prompt. |
If command extensions are enabled (the default), and you use the goto command with a target label of :EOF, you transfer control to the end of the current batch script file and exit the batch script file without defining a label. When you use this command with the :EOF label, you must insert a colon before the label. For example: goto:EOF
.
You can use spaces in the label parameter, but you can't include other separators (for example, semicolons (;) or equal signs (=)).
The label value that you specify must match a label in the batch program. The label within the batch program must begin with a colon (:). If a line begins with a colon, it's treated as a label and any commands on that line are ignored. If your batch program doesn't contain the label that you specify in the label parameter, then the batch program stops and displays the following message: Label not found
.
You can use goto with other commands to perform conditional operations. For more information about using goto for conditional operations, see the if command.
The following batch program formats a disk in drive A as a system disk. If the operation is successful, the goto command directs processing to the :end label:
echo off
format a: /s
if not errorlevel 1 goto end
echo An error occurred during formatting.
:end
echo End of batch program.
Runs a specified command on a remote host. The remote host must be running a rexecd service (or daemon) for rexec to connect to.
[!IMPORTANT] The rexec command has been deprecated, and isn't guaranteed to be supported in Windows.
Ends a full backup session and issues a BackupComplete event with the appropriate writer state, if needed.
end backup
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the name of the root server used for queries.
[!NOTE] This command supports the nslookup root command.
set root=<rootserver>
Parameter | Description |
---|---|
<rootserver> |
Specifies the new name for the root server. The default value is ns.nic.ddn.mil. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Displays or modifies file types that are used in file name extension associations. If used without an assignment operator (=), this command displays the current open command string for the specified file type. If used without parameters, this command displays the file types that have open command strings defined.
[!NOTE] This command is only supported within cmd.exe and is not available from PowerShell. Though you can use
cmd /c ftype
as a workaround.
ftype [<filetype>[=[<opencommandstring>]]]
Parameter | Description |
---|---|
<filetype> |
Specifies the file type to display or change. |
<opencommandstring> |
Specifies the open command string to use when opening files of the specified file type. |
/? | Displays help at the command prompt. |
The following table describes how ftype substitutes variables within an open command string:
Variable | Replacement value |
---|---|
%0 or %1 |
Gets substituted with the file name being launched through the association. |
%* |
Gets all of the parameters. |
%2 , %3 , ... |
Gets the first parameter (%2 ), the second parameter (%3 ), and so on. |
%~<n> |
Gets all of the remaining parameters starting with the nth parameter, where n can be any number from 2 to 9. |
To display the current file types that have open command strings defined, type:
ftype
To display the current open command string for the txtfile file type, type:
ftype txtfile
This command produces output similar to the following:
txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1
To delete the open command string for a file type called example, type:
ftype example=
To associate the .pl file name extension with the PerlScript file type and enable the PerlScript file type to run PERL.EXE, type the following commands:
assoc .pl=PerlScript
ftype PerlScript=perl.exe %1 %*
To eliminate the need to type the .pl file name extension when invoking a Perl script, type:
set PATHEXT=.pl;%PATHEXT%
FveUpdate is an internal tool, used by the setup program when a computer is upgraded. It updates the metadata associated with BitLocker to the latest version. This tool cannot be run independently.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the resource record type for the query. For information about resource record types, see Request for Comment (Rfc) 1035.
[!NOTE] This command is the same as the nslookup set type command.
set querytype=<resourcerecordtype>
Parameter | Description |
---|---|
<resourcerecordtype> |
Specifies a DNS resource record type. The default resource record type is A, but you can use any of the following values:
|
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays the names and locations of the TAPI application directory partitions in the domain.
tapicfg show [/defaultonly] [/domain:<domainname>]
Parameter | Description |
---|---|
/default only | Displays the names and locations of only the default TAPI application directory partition in the domain. |
/domain: <domainname> |
Specifies the DNS name of the domain for which the TAPI application directory partitions are displayed. If the domain name isn't specified, the name of the local domain is used. |
/? | Displays help at the command prompt. |
This command-line tool can be run on any computer that is a member of the domain.
User-supplied text (such as the names of TAPI application directory partitions, servers, and domains) with International or Unicode characters are only displayed correctly if appropriate fonts and language support are installed.
You can still use Internet Locator Service (ILS) servers in your organization, if ILS is needed to support certain applications, because TAPI clients running Windows XP or a Windows Server 2003 operating system can query either ILS servers or TAPI application directory partitions.
You can use tapicfg to create or remove service connection points. If the TAPI application directory partition is renamed for any reason (for example, if you rename the domain in which it resides), you must remove the existing service connection point and create a new one that contains the new DNS name of the TAPI application directory partition to be published. Otherwise, TAPI clients are unable to locate and access the TAPI application directory partition. You can also remove a service connection point for maintenance or security purposes (for example, if you do not want to expose TAPI data on a specific TAPI application directory partition).
To display the name of the default TAPI application directory partition for the new domain, type:
tapicfg show /defaultonly
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Repairs the RAID-5 volume with focus by replacing the failed disk region with the specified dynamic disk.
A volume in a RAID-5 array must be selected for this operation to succeed. Use the select volume command to select a volume and shift the focus to it.
repair disk=<n> [align=<n>] [noerr]
Parameter | Description |
---|---|
disk=<n> |
Specifies the dynamic disk that will replace the failed disk region. Where n must have free space greater than or equal to the total size of the failed disk region in the RAID-5 volume. |
align=<n> |
Aligns all volume or partition extents to the closest alignment boundary. Where n is the number of kilobytes (KB) from the beginning of the disk to the closest alignment boundary. |
noerr | for scripting only. When an error is encountered, DiskPart continues to process commands as if the error didn't occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To replace the volume with focus by replacing it with dynamic disk 4, type:
repair disk=4
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Renames files or directories.
[!NOTE] This command is the same as the rename command.
ren [<drive>:][<path>]<filename1> <filename2>
Parameter | Description |
---|---|
[<drive>:][<path>]<filename1> |
Specifies the location and name of the file or set of files you want to rename. Filename1 can include wildcard characters (* and ?). |
<filename2> |
Specifies the new name for the file. You can use wildcard characters to specify new names for multiple files. |
/? | Displays help at the command prompt. |
You can't specify a new drive or path when renaming files. You also can't use this command to rename files across drives or to move files to a different directory.
Characters represented by wildcard characters in filename2 will be identical to the corresponding characters in filename1.
Filename2 must be a unique file name. If filename2 matches an existing file name, the following message appears: Duplicate file name or file not found
.
To change all the .txt file name extensions in the current directory to .doc extensions, type:
ren *.txt *.doc
To change the name of a directory from Chap10 to Part10, type:
ren chap10 part10
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Package existing files into a cabinet (.cab) file. This command performs the same actions as the updated makecab command.
diantz [/v[n]] [/d var=<value> ...] [/l <dir>] <source> [<destination>]
diantz [/v[<n>]] [/d var=<value> ...] /f <directives_file> [...]
Parameter | Description |
---|---|
<source> |
File to compress. |
<destination> |
File name to give compressed file. If omitted, the last character of the source file name is replaced with an underscore (_) and used as the destination. |
/f <directives_file> |
A file with diantz directives (may be repeated). |
/d var=<value> |
Defines variable with specified value. |
/l <dir> |
Location to place destination (default is current directory). |
/v[<n> ] |
Set debugging verbosity level (0=none,...,3=full). |
/? | Displays help at the command prompt. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Toggles Verbose mode. By default, Verbose mode is turned on. When Verbose mode is on, all ftp command responses are displayed. When a file transfer is completed, statistics regarding the efficiency of the transfer are also displayed.
verbose
To toggle Verbose mode on and off, type:
verbose
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Diagnoses side-by-side problems.
sxstrace [{[trace -logfile:<filename> [-nostop]|[parse -logfile:<filename> -outfile:<parsedfile> [-filter:<appname>]}]
Parameter | Description |
---|---|
trace | Enables tracing for side-by-side. |
-logfile | Specifies the raw log file. |
<filename> |
Saves tracing log to <filename . |
-nostop | Specifies that you shouldn't receive a prompt to stop tracing. |
parse | Translates the raw trace file. |
-outfile | Specifies the output filename. |
<parsedfile> |
Specifies the filename of the parsed file. |
-filter | Allows the output to be filtered. |
<appname> |
Specifies the name of the application. |
stoptrace | Stops the trace, if it wasn't stopped before. |
-? | Displays help at the command prompt. |
To enable tracing and to save the trace file to sxstrace.etl, type:
sxstrace trace -logfile:sxstrace.etl
To translate the raw trace file into a human readable format and to save the result to sxstrace.txt, type:
sxstrace parse -logfile:sxstrace.etl -outfile:sxstrace.txt
Displays WMI information inside an interactive command shell.
wmic </parameter>
The following sub-commands are available at all times:
Sub-command | Description |
---|---|
class | Escapes from the default alias mode of WMIC to access classes in the WMI schema directly. |
path | Escapes from the default alias mode of WMIC to access instances in the WMI schema directly. |
context | Displays the current values of all global switches. |
[quit | exit] | Exits the WMIC command shell. |
To display the current values of all global switches, type:
wmic context
Output similar to the following displays:
NAMESPACE : root\cimv2
ROLE : root\cli
NODE(S) : BOBENTERPRISE
IMPLEVEL : IMPERSONATE
[AUTHORITY : N/A]
AUTHLEVEL : PKTPRIVACY
LOCALE : ms_409
PRIVILEGES : ENABLE
TRACE : OFF
RECORD : N/A
INTERACTIVE : OFF
FAILFAST : OFF
OUTPUT : STDOUT
APPEND : STDOUT
USER : N/A
AGGREGATE : ON
To change the language ID used by the command line to English (locale ID 409), type:
wmic /locale:ms_409
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays the current status of ftp connections.
status
To display the current status of ftp connections, type:
status
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Deletes a remote directory.
rmdir <directory>
Parameter | Description |
---|---|
<directory> |
Specifies the name of the remote directory to delete. |
To delete the pictures remote directory, type:
rmdir pictures
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Deletes an image from a server.
for boot images:
wdsutil [Options] /remove-Image:<Image name> [/Server:<Server name> type:Boot /Architecture:{x86 | ia64 | x64} [/Filename:<Filename>]
for install images:
wdsutil [Options] /remove-image:<Image name> [/Server:<Server name> type:Install ImageGroup:<Image group name>] [/Filename:<Filename>]
Parameter | Description |
---|---|
/remove-image:<Image name> | Specifies the name of the image. |
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
mediatype:{Boot | Install} | Specifies the type of image. |
/Architecture:{x86 | ia64 | x64} | Specifies the architecture of the image. Because it is possible to have the same image name for different boot images in different architectures, specifying the architecture value ensures that the correct image will be removed. |
\ImageGroup:<Image group name>] | Specifies the image group that contains the image. If no image group name is specified and only one image group exists on the server, that image group will be used. If more than one image group exists, you must use this option to specify the image group. |
[/Filename:<File name>] | if the image cannot be uniquely identified by name, you must use this option to specify the file name. |
To remove a boot image, type:
wdsutil /remove-Imagmedia:WinPE Boot Imagemediatype:Boot /Architecture:x86
wdsutil /verbose /remove-Image:WinPE Boot Image /Server:MyWDSServer type:Boot /Architecture:x64 /Filename:boot.wim
To remove an install image, type:
wdsutil /remove-Image:Windows Vista with Officemediatype:Install
wdsutil /verbose /remove-Image:Windows Vista with Office /Server:MyWDSServemediatype:Instal ImageGroup:ImageGroup1 /Filename:install.wim
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Copies a remote file to the local computer using the current file transfer type.
[!NOTE] This command is the same as the ftp get command.
recv <remotefile> [<localfile>]
Parameter | Description |
---|---|
<remotefile> |
Specifies the remote file to copy. |
[<localfile>] |
Specifies the name of the file to use on the local computer. If localfile isn't specified, the file is given the name of the remotefile. |
To copy test.txt to the local computer using the current file transfer, type:
recv test.txt
To copy test.txt to the local computer as test1.txt using the current file transfer, type:
recv test.txt test1.txt
Cprofile is deprecated and is not guaranteed to be supported in future releases of Windows.
Terminal Services has been updated to Remote Desktop Services. For more information, see Welcome to Remote Desktop Services.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Copies remote files to the local computer using the current file transfer type.
mget <remotefile>[ ]
Parameter | Description |
---|---|
<remotefile> |
Specifies the remote files to copy to the local computer. |
To copy remote files a.exe and b.exe to the local computer using the current file transfer type, type:
mget a.exe b.exe
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.
color [[<b>]<f>]
Parameter | Description |
---|---|
<b> |
Specifies the background color. |
<f> |
Specifies the foreground color. |
/? | Displays help at the command prompt. |
Where:
The following table lists valid hexadecimal digits that you can use as the values for <b>
and <f>
:
Value | Color |
---|---|
0 | Black |
1 | Blue |
2 | Green |
3 | Aqua |
4 | Red |
5 | Purple |
6 | Yellow |
7 | White |
8 | Gray |
9 | Light blue |
a | Light green |
b | Light aqua |
c | Light red |
d | Light purple |
e | Light yellow |
f | Bright white |
Don't use space characters between <b>
and <f>
.
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 <b>
and <f>
are the same color value, the ERRORLEVEL is set to 1
, and no change is made to either the foreground or the background color.
To change the Command Prompt window background color to gray and the foreground color to red, type:
color 84
To change the Command Prompt window foreground color to light yellow, type:
color e
[!NOTE] In this example, the background is set to the default color because only one hexadecimal digit is specified.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Toggles number sign (#) printing for each transferred data block. By default, the hash command is turned off. The size of a data block is 2048 bytes.
hash
To toggle number sign (#) printing for each data block that is transferred, type:
hash
Prepares an existing simple dynamic volume for use as a boot or system volume. If you use a master boot record (MBR) dynamic disk, this command creates a partition entry in the master boot record. If you use a GUID partition table (GPT) dynamic disk, this command creates a partition entry in the GUID partition table.
retain
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sends verbatim arguments to the remote ftp server. A single ftp reply code is returned.
[!NOTE] This command is the same as the ftp literal command.
quote <argument>[ ]
Parameter | Description |
---|---|
<argument> |
Specifies the argument to send to the ftp server. |
To send a quit command to the remote ftp server, type:
quote quit
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the working directory on the local computer. By default, the working directory is the directory in which the ftp command was started.
lcd [<directory>]
Parameter | Description |
---|---|
[<directory>] |
Specifies the directory on the local computer to which to change. If directory isn't specified, the current working directory is changed to the default directory. |
To change the working directory on the local computer to c:\dir1, type:
lcd c:\dir1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Toggles allowing wildcard expansion for local file names. By default, globbing (wildcard expansion) is turned on. If globbing is turned on, you'll be able to use the asterisk (*) and question mark (?) as wildcard characters in local file or path names.
glob
To toggle whether to allow wildcard expansion of local file names, type:
glob
Modifies the password for a data drive. The user is prompted for a new password.
manage-bde -changepassword [<drive>] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<drive> |
Represents a drive letter followed by a colon. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To change the password used to unlock BitLocker on data drive D, type:
manage-bde –changepassword D:
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays information about processes, sessions, and Remote Desktop Session Host servers. To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server.
query process
query session
query termserver
query user
Parameter | Description |
---|---|
query process | Displays information about processes running on an Remote Desktop Session Host server. |
query session | Displays information about sessions on a Remote Desktop Session Host server. |
query termserver | Displays a list of all Remote Desktop Session Host servers on the network. |
query user | Displays information about user sessions on a Remote Desktop Session Host server. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Deletes files on the remote computer.
mdelete <remotefile>[...]
Parameter | Description |
---|---|
<remotefile> |
Specifies the remote file to delete. |
To delete remote files a.exe and b.exe, type:
mdelete a.exe b.exe
Modifies the startup key for an operating system drive.
manage-bde -changekey [<drive>] [<pathtoexternalkeydirectory>] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<drive> |
Represents a drive letter followed by a colon. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To create a new startup key on drive E, to use with BitLocker encryption on drive C, type:
manage-bde -changekey C: E:\
Sets security flags for HTTP to determine if BITS should check the certificate revocation list, ignore certain certificate errors, and define the policy to use when a server redirects the HTTP request. The value is an unsigned integer.
bitsadmin /setsecurityflags <job> <value>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
value | Can include one or more of the following notification flags, including:
|
To set the security flags to enable a CRL check for the job named myDownloadJob:
bitsadmin /setsecurityflags myDownloadJob 0x0001
Returns the usage flags for a helper token that is associated with a BITS transfer job.
[!NOTE] This command isn't supported by BITS 3.0 and earlier.
bitsadmin /gethelpertokenflags <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
Possible return values, including:
0x0001. The helper token is used to open the local file of an upload job, to create or rename the temporary file of a download job, or to create or rename the reply file of an upload-reply job.
0x0002. The helper token is used to open the remote file of a Server Message Block (SMB) upload or download job, or in response to an HTTP server or proxy challenge for implicit NTLM or Kerberos credentials. You must call /SetCredentialsJob TargetScheme NULL NULL
to allow the credentials to be sent over HTTP.
To retrieve the usage flags for a helper token associated with a BITS transfer job named myDownloadJob:
bitsadmin /gethelpertokenflags myDownloadJob
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Lists the /util switches.
Lists the util switches.
bitsadmin /util /help
bitsadmin /util /getieproxy
bitsadmin /util /repairservice
bitsadmin /util /setieproxy
bitsadmin /util /version
Parameter | Description |
---|---|
bitsadmin util and help | Displays the command-line usage for the /Util switches. You can also specify /?. |
bitsadmin util and getieproxy | Retrieves the proxy usage for the given service account. |
bitsadmin util and repairservice | Repairs known issues with BITS service. |
bitsadmin util and setieproxy | Specifies proxy settings to use when transferring files using a service account. |
bitsadmin util and version | Displays the version of the BITS service. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sets the file transfer type to ASCII. The ftp command supports both ASCII (default) and binary image file transfer types, but we recommend using ASCII when transferring text files. In ASCII mode, character conversions to and from the network standard character set are performed. For example, end-of-line characters are converted as necessary, based on the target operating system.
ascii
To set the file transfer type to ASCII, type:
ascii
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the initial number of seconds to wait for a reply to a lookup request. If a reply isn't received within the specified amount of time, the time-out period is doubled, and the request is resent. Use the nslookup set retry command to determine the number of times to try to send the request.
set timeout=<number>
Parameter | Description |
---|---|
<number> |
Specifies the number of seconds to wait for a reply. The default number of seconds to wait is 5. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
To set the timeout for getting a response to 2 seconds:
set timeout=2
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Disconnects from the remote computer and remains at the ftp>
prompt.
disconnect
To disconnect from the remote computer and remains at the ftp>
prompt, type:
disconnect
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Toggles Debugging mode. By default, Debugging mode is turned off. If Debugging mode is turned on, you'll see each command sent to the remote computer, preceeded by the >
character.
debug
To toggle debug mode on and off, type:
debug
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Deletes files on remote computers.
delete <remotefile>
Parameter | Description |
---|---|
<remotefile> |
Specifies the file to delete. |
To delete the test.txt file on the remote computer, type:
delete test.txt
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the working directory on the remote computer.
cd <remotedirectory>
Parameter | Description |
---|---|
<remotedirectory> |
Specifies the directory on the remote computer to which you want to change. |
To change the directory on the remote computer to Docs, type:
cd Docs
To change the directory on the remote computer to May Videos, type:
cd May Videos
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Ends the ftp session with the remote server and remains at the ftp>
prompt.
close
To end the ftp session with the remote server and remain at the ftp>
prompt, type:
close
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sets the file transfer type to binary. The ftp command supports both ASCII (default) and binary image file transfer types, but we recommend using binary when transferring executable files. In binary mode, files are transferred in one-byte units.
binary
To set the file transfer type to binary, type:
binary
Enables an administrator to create a custom event in a specified event log.
[!IMPORTANT] Custom events can't be written to the security log.
eventcreate [/s <computer> [/u <domain\user> [/p <password>]] {[/l {APPLICATION|SYSTEM}]|[/so <srcname>]} /t {ERROR|WARNING|INFORMATION|SUCCESSAUDIT|FAILUREAUDIT} /id <eventID> /d <description>
Parameter | Description | ||||
---|---|---|---|---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer. | ||||
/u <domain\user> |
Runs the command with the account permissions of the user specified by <user> or <domain\user> . The default is the permissions of the current logged on user on the computer issuing the command. |
||||
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. | ||||
/l `{APPLICATION | SYSTEM}` | Specifies the name of the event log where the event will be created. The valid log names are APPLICATION or SYSTEM. | |||
/so <srcname> |
Specifies the source to use for the event. A valid source can be any string and should represent the application or component that is generating the event. | ||||
/t `{ERROR | WARNING | INFORMATION | SUCCESSAUDIT | FAILUREAUDIT}` | Specifies the type of event to create. The valid types are ERROR, WARNING, INFORMATION, SUCCESSAUDIT, and FAILUREAUDIT. |
/id <eventID> |
Specifies the event ID for the event. A valid ID is any number from 1 to 1000. | ||||
/d <description> |
Specifies the description to use for the newly created event. | ||||
/? | Displays help at the command prompt. |
The following examples show how you can use the eventcreate command:
eventcreate /t ERROR /id 100 /l application /d "Create event in application log"
eventcreate /t INFORMATION /id 1000 /d "Create event in WinMgmt source"
eventcreate /t ERROR /id 201 /so winword /l application /d "New src Winword in application log"
eventcreate /s server /t ERROR /id 100 /l application /d "Remote machine without user credentials"
eventcreate /s server /u user /p password /id 100 /t ERROR /l application /d "Remote machine with user credentials"
eventcreate /s server1 /s server2 /u user /p password /id 100 /t ERROR /d "Creating events on Multiple remote machines"
eventcreate /s server /u user /id 100 /t WARNING /d "Remote machine with partial user credentials"
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Toggles an audible sound to occur after each file transfer command is completed. By default, this command is toggled off.
bell
To toggle an audible sound to occur after each file transfer command is completed, type:
bell
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Checks the configuration of domain controllers by performing the following tests on each domain controller in the specified domain:
Verifies that the Distributed File System (DFS) Namespace service is running and that its startup type is set to Automatic.
Checks for the support of site-costed referrals for NETLOGON and SYSvol.
Verifies the consistency of the site association by hostname and IP address.
dfsdiag /testdcs [/domain:<domain_name>]
Parameter | Description |
---|---|
/domain:<domain_name> |
Name of the domain to check. This parameter is optional. The default value is the local domain to which the local host is joined. |
To verify the configuration of domain controllers in the contoso.com domain, type:
dfsdiag /testdcs /domain:contoso.com
Logs display information to a file.
dispdiag [-testacpi] [-d] [-delay <seconds>] [-out <filepath>]
Parameter | Description |
---|---|
- testacpi | Runs hotkey diagnostics test. Displays the key name, code and scan code for any key pressed during the test. |
-d | Generates a dump file with test results. |
-delay <seconds> |
Delays the collection of data by specified time in seconds. |
-out <filepath> |
Specifies path and filename to save collected data. This must be the last parameter. |
-? | Displays available command parameters and provides help for using them. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8
Manages the update sequence number (USN) change journal. The USN change journal provides a persistent log of all changes made to files on the volume. As files, directories, and other NTFS objects are added, deleted, and modified, NTFS enters records into the USN change journal, one for each volume on the computer. Each record indicates the type of change and the object changed. New records are appended to the end of the stream.
fsutil usn [createjournal] m=<maxsize> a=<allocationdelta> <volumepath>
fsutil usn [deletejournal] {/d | /n} <volumepath>
fsutil usn [enablerangetracking] <volumepath> [options]
fsutil usn [enumdata] <fileref> <lowUSN> <highUSN> <volumepath>
fsutil usn [queryjournal] <volumepath>
fsutil usn [readdata] <filename>
fsutil usn [readjournal] [c= <chunk-size> s=<file-size-threshold>] <volumepath>
Parameter | Description |
---|---|
createjournal | Creates a USN change journal. |
m=<maxsize> |
Specifies the maximum size, in bytes, that NTFS allocates for the change journal. |
a=<allocationdelta> |
Specifies the size, in bytes, of memory allocation that is added to the end and removed from the beginning of the change journal. |
<volumepath> |
Specifies the drive letter (followed by a colon). |
deletejournal | Deletes or disables an active USN change journal. CAUTION: Deleting the change journal impacts the File Replication Service (FRS) and the Indexing Service, because it requires these services to perform a complete (and time-consuming) scan of the volume. This in turn negatively impacts FRS SYSVOL replication and replication between DFS link alternates while the volume is being rescanned. |
/d | Disables an active USN change journal, and returns input/output (I/O) control while the change journal is being disabled. |
/n | Disables an active USN change journal and returns I/O control only after the change journal is disabled. |
enablerangetracking | Enables USN write range tracking for a volume. |
c=<chunk-size> |
Specifies the chunk size to track on a volume. |
s=<file-size-threshold> |
Specifies the file size threshold for range tracking. |
enumdata | Enumerates and lists the change journal entries between two specified boundaries. |
<fileref> |
Specifies the ordinal position within the files on the volume at which the enumeration is to begin. |
<lowUSN> |
Specifies the lower boundary of the range of USN values used to filter the records that are returned. Only records whose last change journal USN is between or equal to the lowUSN and highUSN member values are returned. |
<highUSN> |
Specifies the upper boundary of the range of USN values used to filter the files that are returned. |
queryjournal | Queries a volume's USN data to gather information about the current change journal, its records, and its capacity. |
readdata | Reads the USN data for a file. |
<filename> |
Specifies the full path to the file, including the file name and extension For example: C:\documents\filename.txt. |
readjournal | Reads the USN records in the USN journal. |
minver=<number> |
Minimum Major Version of USN_RECORD to return. Default = 2. |
maxver=<number> |
Maximum Major Version of USN_RECORD to return. Default = 4. |
startusn=<USN number> |
USN to start reading the USN journal from. Default = 0. |
Programs can consult the USN change journal to determine all the modifications made to a set of files. The USN change journal is much more efficient than checking time stamps or registering for file notifications. The USN change journal is enabled and used by the Indexing Service, File Replication Service (FRS), Remote Installation Services (RIS), and Remote Storage.
If a change journal already exists on a volume, the createjournal parameter updates the change journal's maxsize and allocationdelta parameters. This enables you to expand the number of records that an active journal maintains without having to disable it.
The change journal can grow larger than this target value, but the change journal is truncated at the next NTFS checkpoint to less than this value. NTFS examines the change journal and trims it when its size exceeds the value of maxsize plus the value of allocationdelta. At NTFS checkpoints, the operating system writes records to the NTFS log file that enable NTFS to determine what processing is required to recover from a failure.
The change journal can grow to more than the sum of the values of maxsize and allocationdelta before being trimmed.
Deleting or disabling an active change journal is very time consuming, because the system must access all the records in the master file table (MFT) and set the last USN attribute to 0 (zero). This process can take several minutes, and it can continue after the system restarts, if a restart is necessary. During this process, the change journal is not considered active, nor is it disabled. While the system is disabling the journal, it cannot be accessed, and all journal operations return errors. You should use extreme care when disabling an active journal, because it adversely affects other applications that are using the journal.
To create a USN change journal on drive C, type:
fsutil usn createjournal m=1000 a=100 c:
To delete an active USN change journal on drive C, type:
fsutil usn deletejournal /d c:
To enable range tracking with a specified chunk-size and file-size-threshold, type:
fsutil usn enablerangetracking c=16384 s=67108864 C:
To enumerate and list the change journal entries between two specified boundaries on drive C, type:
fsutil usn enumdata 1 0 1 c:
To query USN data for a volume on drive C, type:
fsutil usn queryjournal c:
To read the USN data for a file in the \Temp folder on drive C, type:
fsutil usn readdata c:\temp\sample.txt
To read the USN journal with a specific start USN, type:
fsutil usn readjournal startusn=0xF00
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Configures the translation of events to traps, trap destinations, or both based on information in a configuration file.
evntcmd [/s <computername>] [/v <verbositylevel>] [/n] <filename>
Parameter | Description |
---|---|
/s <computername> |
Specifies, by name, the computer on which you want to configure the translation of events to traps, trap destinations, or both. If you do not specify a computer, the configuration occurs on the local computer. |
/v <verbositylevel> |
Specifies which types of status messages appear as traps and trap destinations are configured. This parameter must be an integer between 0 and 10. If you specify 10, all types of messages appear, including tracing messages and warnings about whether trap configuration was successful. If you specify 0, no messages appear. |
/n | Specifies that the SNMP service should not be restarted if this computer receives trap configuration changes. |
<filename> |
Specifies, by name, the configuration file that contains information about the translation of events to traps and trap destinations you want to configure. |
/? | Displays help at the command prompt. |
if you want to configure traps but not trap destinations, you can create a valid configuration file by using Event to Trap Translator, which is a graphical utility. If you have the SNMP service installed, you can start Event to Trap Translator by typing evntwin at a command prompt. After you have defined the traps you want, click Export to create a file suitable for use with evntcmd. You can use Event to Trap Translator to easily create a configuration file and then use the configuration file with evntcmd at the command prompt to quickly configure traps on multiple computers.
The syntax for configuring a trap is as follows:
#pragma add <eventlogfile> <eventsource> <eventID> [<count> [<period>]]
Where the text following is true:
- **#pragma** must appear at the beginning of every entry in the file.
- The parameter **add** specifies that you want to add an event to trap configuration.
- The parameters **eventlogfile**, **eventsource**, and **eventID** are required, and where **eventlogfile** specifies the file in which the event is recorded, **eventsource** specifies the application that generates the event and **eventID** specifies the unique number that identifies each event.
To determine what values correspond to each event, start the Event to Trap Translator by typing **evntwin** at a command prompt. Click **Custom**, and then click **edit**. Under **Event Sources**, browse the folders until you locate the event you want to configure, click it, and then click **add**. Information about the event source, the event log file, and the event ID appear under **Source, Log**, and **Trap specific ID**, respectively.
- The **count** parameter is optional, and it specifies how many times the event must occur before a trap message is sent. If you don't use this parameter, the trap message is sent after the event occurs once.
- The **period** parameter is optional, but it requires you to use the **count** parameter. The **period** parameter specifies a length of time (in seconds) during which the event must occur the number of times specified with the **count** parameter before a trap message is sent. If you don't use this parameter, a trap message is sent after the event occurs the number of times specified with the ***count*** parameter, no matter how much time elapses between occurrences.
#pragma delete <eventlogfile> <eventsource> <eventID>
Where the text following is true:
- **#pragma** must appear at the beginning of every entry in the file.
- The parameter **delete** specifies that you want to remove an event to trap configuration.
- The parameters **eventlogfile**, **eventsource**, and **eventID** are required, and where **eventlogfile** specifies the file in which the event is recorded, **eventsource** specifies the application that generates the event and **eventID** specifies the unique number that identifies each event.
To determine what values correspond to each event, start the Event to Trap Translator by typing **evntwin** at a command prompt. Click **Custom**, and then click **edit**. Under **Event Sources**, browse the folders until you locate the event you want to configure, click it, and then click **add**. Information about the event source, the event log file, and the event ID appear under **Source, Log**, and **Trap specific ID**, respectively.
#pragma add_TRAP_DEST <communityname> <hostID>
Where the text following is true:
- **#pragma** must appear at the beginning of every entry in the file.
- The parameter **add_TRAP_DEST** specifies that you want trap messages to be sent to a specified host within a community.
- The parameter **communityname** specifies, by name, the community in which trap messages are sent.
- The parameter **hostID** specifies, by name or IP address, the host to which you want trap messages to be sent.
#pragma delete_TRAP_DEST <communityname> <hostID>
Where the text following is true:
- **#pragma** must appear at the beginning of every entry in the file.
- The parameter **delete_TRAP_DEST** specifies that you do not want trap messages to be sent to a specified host within a community.
- The parameter **communityname** specifies, by name, the community to which trap messages shouldn't be sent.
- The parameter **hostID** specifies, by name or IP address, the host to which you don't want trap messages to be sent.
The following examples illustrate entries in the configuration file for the evntcmd command. They are not designed to be typed at a command prompt.
To send a trap message if the Event Log service is restarted, type:
#pragma add System Eventlog 2147489653
To send a trap message if the Event Log service is restarted twice in three minutes, type:
#pragma add System Eventlog 2147489653 2 180
To stop sending a trap message whenever the Event Log service is restarted, type:
#pragma delete System Eventlog 2147489653
To send trap messages within the community named Public to the host with the IP address 192.168.100.100, type:
#pragma add_TRAP_DEST public 192.168.100.100
To send trap messages within the community named Private to the host named Host1, type:
#pragma add_TRAP_DEST private Host1
To stop sending trap messages within the community named Private to the same computer on which you are configuring trap destinations, type:
#pragma delete_TRAP_DEST private localhost
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Queries and displays the [boot loader] and [operating systems] section entries from Boot.ini.
bootcfg /query [/s <computer> [/u <domain>\<user> /p <password>]]
Parameter | Description |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (don't use backslashes). The default is the local computer. |
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by <user> or <domain>\<user> . The default is the permissions of the current logged on user on the computer issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
/? | Displays help at the command prompt. |
Sample output for the bootcfg /query command:
Boot Loader Settings
----------
timeout: 30
default: multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
Boot Entries
------
Boot entry ID: 1
Friendly Name:
path: multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
OS Load Options: /fastdetect /debug /debugport=com1:
The Boot Loader Settings area shows each entry in the [boot loader] section of Boot.ini.
The Boot Entries area shows more details for each operating system entry in the [operating systems] section of the Boot.ini
To use the bootcfg /query command:
bootcfg /query
bootcfg /query /s srvmain /u maindom\hiropln /p p@ssW23
bootcfg /query /u hiropln /p p@ssW23
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8
Manages NTFS transactions.
fsutil transaction [commit] <GUID>
fsutil transaction [fileinfo] <filename>
fsutil transaction [list]
fsutil transaction [query] [{files | all}] <GUID>
fsutil transaction [rollback] <GUID>
Parameter | Description |
---|---|
commit | Marks the end of a successful implicit or explicit specified transaction. |
<GUID> |
Specifies the GUID value that represents a transaction. |
fileinfo | Displays transaction information for the specified file. |
<filename> |
Specifies full path and file name. |
list | Displays a list of currently running transactions. |
query | Displays information for the specified transaction.
|
rollback | Rolls back a specified transaction to the beginning. |
To display transaction information for file c:\test.txt, type:
fsutil transaction fileinfo c:\test.txt
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8
Queries or sets a volume's dirty bit. When a volume's dirty bit is set, autochk automatically checks the volume for errors the next time the computer is restarted.
fsutil dirty {query | set} <volumepath>
Parameter | Description |
---|---|
query | Queries the specified volume's dirty bit. |
set | Sets the specified volume's dirty bit. |
<volumepath> |
Specifies the drive name followed by a colon or GUID in the following format: volume{GUID} . |
A volume's dirty bit indicates that the file system may be in an inconsistent state. The dirty bit can be set because:
The volume is online and it has outstanding changes.
Changes were made to the volume and the computer was shut down before the changes were committed to the disk.
Corruption was detected on the volume.
If the dirty bit is set when the computer restarts, chkdsk runs to verify the file system integrity and to attempt to fix any issues with the volume.
To query the dirty bit on drive C, type:
fsutil dirty query c:
If the volume is dirty, the following output displays: Volume C: is dirty
If the volume isn't dirty, the following output displays: Volume C: is not dirty
To set the dirty bit on drive C, type:
fsutil dirty set C:
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Checks to see if the specified amount of disk space is available before continuing with an installation process.
freedisk [/s <computer> [/u [<domain>\]<user> [/p [<password>]]]] [/d <drive>] [<value>]
Parameter | Description |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (do not use backslashes). The default is the local computer. This parameter applies to all files and folders specified in the command. |
/u [<domain> \]<user> |
Runs the script with the permissions of the specified user account. The default is system permissions. |
/p [<password> ] |
Specifies the password of the user account that is specified in /u. |
/d <drive> |
Specifies the drive for which you want to find out the availability of free space. You must specify <drive> for a remote computer. |
<value> |
Checks for a specific amount of free disk space. You can specify <value> in bytes, KB, MB, GB, TB, PB, EB, ZB, or YB. |
Using the /s, /u, and /p command-line options are available only when you use /s. You must use /p with /uto provide the user's password.
For unattended installations, you can use freedisk in installation batch files to check for the prerequisite amount free space before continuing with the installation.
When you use freedisk in a batch file, it returns a 0 if there's enough space and a 1 if there's not enough space.
To determine whether there are at least 50 MB of free space available on drive C, type:
freedisk 50mb
Output similar to the following example appears on the screen:
INFO: The specified 52,428,800 byte(s) of free space is available on current drive.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a striped volume using two or more specified dynamic disks. After you create the volume, the focus automatically shifts to the new volume.
create volume stripe [size=<n>] disk=<n>,<n>[,<n>,...] [align=<n>] [noerr]
Parameter | Description |
---|---|
size=<n> |
The amount of disk space, in megabytes (MB), that the volume will occupy on each disk. If no size is given, the new volume takes up the remaining free space on the smallest disk and an equal amount of space on each subsequent disk. |
disk=<n>,<n>[,<n>,...] |
The dynamic disks on which the striped volume is created. You need at least two dynamic disks to create a striped volume. An amount of space equal to size=<n> is allocated on each disk. |
align=<n> |
Aligns all volume extents to the closest alignment boundary. Typically used with hardware RAID Logical Unit Number (LUN) arrays to improve performance. <n> is the number of kilobytes (KB) from the beginning of the disk to the closest alignment boundary. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To create a striped volume of 1000 megabytes in size, on disks 1 and 2, type:
create volume stripe size=1000 disk=1,2
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a simple volume on the specified dynamic disk. After you create the volume, the focus automatically shifts to the new volume.
create volume simple [size=<n>] [disk=<n>] [align=<n>] [noerr]
Parameter | Description |
---|---|
size=<n> |
The size of the volume in megabytes (MB). If no size is given, the new volume takes up the remaining free space on the disk. |
disk=<n> |
The dynamic disk on which the volume is created. If no disk is specified, the current disk is used. |
align=<n> |
Aligns all volume extents to the closest alignment boundary. Typically used with hardware RAID Logical Unit Number (LUN) arrays to improve performance. <n> is the number of kilobytes (KB) from the beginning of the disk to the closest alignment boundary. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To create a volume of 1000 megabytes in size, on disk 1, type:
create volume simple size=1000 disk=1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8
Lists all drives, queries the drive type, queries volume information, queries NTFS-specific volume information, or queries file system statistics.
fsutil fsinfo [drives]
fsutil fsinfo [drivetype] <volumepath>
fsutil fsinfo [ntfsinfo] <rootpath>
fsutil fsinfo [statistics] <volumepath>
fsutil fsinfo [volumeinfo] <rootpath>
Parameter | Description |
---|---|
drives | Lists all drives in the computer. |
drivetype | Queries a drive and lists its type, for example CD-ROM drive. |
ntfsinfo | Lists NTFS specific volume information for the specified volume, such as the number of sectors, total clusters, free clusters, and the start and end of the MFT Zone. |
sectorinfo | Lists information about the hardware's sector size and alignment. |
statistics | Lists file system statistics for the specified volume, such as metadata, log file, and MFT reads and writes. |
volumeinfo | Lists information for the specified volume, such as the file system, and whether the volume supports case-sensitive file names, unicode in file names, disk quotas, or is a DirectAccess (DAX) volume. |
<volumepath>: |
Specifies the drive letter (followed by a colon). |
<rootpath>: |
Specifies the drive letter (followed by a colon) of the root drive. |
To list all of the drives in the computer, type:
fsutil fsinfo drives
Output similar to the following displays:
Drives: A:\ C:\ D:\ E:\
To query the drive type of drive C, type:
fsutil fsinfo drivetype c:
Possible results of the query include:
Unknown Drive
No such Root Directory
Removable Drive, for example floppy
Fixed Drive
Remote/Network Drive
CD-ROM Drive
Ram Disk
To query the volume information for volume E, type:
fsinfo volumeinfo e:\
Output similar to the following displays:
Volume Name : Volume
Serial Number : 0xd0b634d9
Max Component Length : 255
File System Name : NTFS
Supports Named Streams
Is DAX Volume
To query drive F for NTFS-specific volume information, type:
fsutil fsinfo ntfsinfo f:
Output similar to the following displays:
NTFS Volume Serial Number : 0xe660d46a60d442cb
Number Sectors : 0x00000000010ea04f
Total Clusters : 0x000000000021d409
Mft Zone End : 0x0000000000004700
To query the file system's underlying hardware for sector information, type:
fsinfo sectorinfo d:
Output similar to the following displays:
D:\>fsutil fsinfo sectorinfo d:
LogicalBytesPerSector : 4096
PhysicalBytesPerSectorForAtomicity : 4096
Trim Not Supported
DAX capable
To query the file system statistics for drive E, type:
fsinfo statistics e:
Output similar to the following displays:
File System Type : NTFS
Version : 1
UserFileReads : 75021
UserFileReadBytes : 1305244512
LogFileWriteBytes : 180936704
Displays the properties of the selected partition. Before you begin, you must select a partition for this operation to succeed. Use the select partition command to select a partition and shift the focus to it.
detail partition
To see the properties of the selected partition, type:
detail partition
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8, Windows Server 2008 R2, Windows 7
Performs tasks that are related to file allocation table (FAT) and NTFS file systems, such as managing reparse points, managing sparse files, or dismounting a volume. If it's used without parameters, fsutil displays a list of supported subcommands.
[!NOTE] You must be logged on as an administrator or a member of the Administrators group to use fsutil. This command is quite powerful and should be used only by advanced users who have a thorough knowledge of Windows operating systems.
You must enable Windows Subsystem for Linux before you can run fsutil. Run the following command as Administrator in PowerShell to enable this optional feature:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
You'll be prompted to restart your computer once it's installed. After your computer restarts, you'll be able to run Fsutil as an administrator.
Subcommand | Description |
---|---|
fsutil 8dot3name | Queries or changes the settings for short name behavior on the system, for example, generates 8.3 character-length file names. Removes short names for all files within a directory. Scans a directory and identifies registry keys that might be impacted if short names were stripped from the files in the directory. |
fsutil dirty | Queries whether the volume's dirty bit is set or sets a volume's dirty bit. When a volume's dirty bit is set, autochk automatically checks the volume for errors the next time the computer is restarted. |
fsutil file | Finds a file by user name (if Disk Quotas are enabled), queries allocated ranges for a file, sets a file's short name, sets a file's valid data length, sets zero data for a file, creates a new file of a specified size, finds a file ID if given the name, or finds a file link name for a specified file ID. |
fsutil fsinfo | Lists all drives and queries the drive type, volume information, NTFS-specific volume information, or file system statistics. |
fsutil hardlink | Lists hard links for a file, or creates a hard link (a directory entry for a file). Every file can be considered to have at least one hard link. On NTFS volumes, each file can have multiple hard links, so a single file can appear in many directories (or even in the same directory, with different names). Because all of the links reference the same file, programs can open any of the links and modify the file. A file is deleted from the file system only after all links to it are deleted. After you create a hard link, programs can use it like any other file name. |
fsutil objectid | Manages object identifiers, which are used by the Windows operating system to track objects such as files and directories. |
fsutil quota | Manages disk quotas on NTFS volumes to provide more precise control of network-based storage. Disk quotas are implemented on a per-volume basis and enable both hard- and soft-storage limits to be implemented on a per-user basis. |
fsutil repair | Queries or sets the self-healing state of the volume. Self-healing NTFS attempts to correct corruptions of the NTFS file system online without requiring Chkdsk.exe to be run. Includes initiating on-disk verification and waiting for repair completion. |
fsutil reparsepoint | Queries or deletes reparse points (NTFS file system objects that have a definable attribute containing user-controlled data). Reparse points are used to extend functionality in the input/output (I/O) subsystem. They are used for directory junction points and volume mount points. They are also used by file system filter drivers to mark certain files as special to that driver. |
fsutil resource | Creates a Secondary Transactional Resource Manager, starts or stops a Transactional Resource Manager, displays information about a Transactional Resource Manager or modifies its behavior. |
fsutil sparse | Manages sparse files. A sparse file is a file with one or more regions of unallocated data in it. A program will see these unallocated regions as containing bytes with the value zero, but no disk space is used to represent these zeros. All meaningful or nonzero data is allocated, whereas all non-meaningful data (large strings of data composed of zeros) is not allocated. When a sparse file is read, allocated data is returned as stored and unallocated data is returned as zeros (by default in accordance with the C2 security requirement specification). Sparse file support allows data to be deallocated from anywhere in the file. |
fsutil tiering | Enables management of storage tier functions, such as setting and disabling flags and listing of tiers. |
fsutil transaction | Commits a specified transaction, rolls back a specified transaction, or displays info about the transaction. |
fsutil usn | Manages the update sequence number (USN) change journal, which provides a persistent log of all changes made to files on the volume. |
fsutil volume | Manages a volume. Dismounts a volume, queries to see how much free space is available on a disk, or finds a file that is using a specified cluster. |
fsutil wim | Provides functions to discover and manage WIM-backed files. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Enables or disables logons from client sessions on an Remote Desktop Session Host server, or displays current logon status.
[!NOTE] This command has been replaced by the change log command. For more information, including the syntax and parameter details, see change logon command.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays the name of the current directory or changes the current directory. If used with only a drive letter (for example, chdir C:
), chdir displays the names of the current directory in the specified drive. If used without parameters, chdir displays the current drive and directory.
[!NOTE] This command has been replaced by the cd command. For more information, including the syntax and parameter details, see cd command.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
The dfsutil command manages DFS Namespaces, servers, and clients.
The DFSN PowerShell module provides equivalent functionality to the following dfsutil parameters.
Parameter | Description |
---|---|
root | Displays, creates, removes, imports, exports namespace roots. |
link | Displays, creates, removes, or moves folders (links). |
target | Displays, create, remove folder target or namespace server. |
property | Displays or modifies a folder target or namespace server. |
server | Displays or modifies namespace configuration. |
domain | Displays all domain-based namespaces in a domain. |
The following functionality is available only as dfsutil parameters:
Parameter | Description |
---|---|
client | Displays or modifies client information or registry keys. |
diag | Perform diagnostics or view dfsdirs/dfspath. |
cache | Displays or flushes the client cache. |
For more info about each of these commands, open a command prompt on a server with the DFS Namespaces management tools installed, and then type dfsutil client /?
, dfsutil diag /?
, or dfsutil cache /?
.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays the name of the current directory or changes the current directory. If used with only a drive letter (for example, cd C:
), cd displays the names of the current directory in the specified drive. If used without parameters, cd displays the current drive and directory.
[!NOTE] This command is the same as the chdir command.
cd [/d] [<drive>:][<path>]
cd [..]
chdir [/d] [<drive>:][<path>]
chdir [..]
Parameter | Description |
---|---|
/d | Changes the current drive as well as the current directory for a drive. |
<drive>: |
Specifies the drive to display or change (if different from the current drive). |
<path> |
Specifies the path to the directory that you want to display or change. |
[..] | Specifies that you want to change to the parent folder. |
/? | Displays help at the command prompt. |
If command extensions are enabled, the following conditions apply to the cd command:
The current directory string is converted to use the same case as the names on the disk. For example, cd c:\temp
would set the current directory to C:\Temp if that is the case on the disk.
Spaces aren't treated as delimiters, so <path>
can contain spaces without enclosing quotation marks. For example:
cd username\programs\start menu
is the same as:
cd "username\programs\start menu"
If extensions are disabled, the quotation marks are required.
cmd /e:off
To return to the root directory, the top of the directory hierarchy for a drive:
cd\
To change the default directory on a drive that is different from the one you are on:
cd [<drive>:[<directory>]]
To verify the change to the directory, type:
cd [<drive>:]
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays information about users on a specified remote computer (typically a computer running UNIX) that is running the finger service or daemon. The remote computer specifies the format and output of the user information display. Used without parameters, finger displays help.
[!IMPORTANT] This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network Connections.
finger [-l] [<user>] [@<host>] [...]
Parameter | Description |
---|---|
-l | Displays user information in long list format. |
<user> |
Specifies the user about which you want information. If you omit the user parameter, this command displays information about all users on the specified computer. |
@<host> |
Specifies the remote computer running the finger service where you are looking for user information. You can specify a computer name or IP address. |
/? | Displays help at the command prompt. |
You must prefix finger parameters with a hyphen (-) rather than a slash (/).
Multiple user@host
parameters can be specified.
To display information for user1 on the computer users.microsoft.com, type:
finger user1@users.microsoft.com
To display information for all users on the computer users.microsoft.com, type:
finger @users.microsoft.com
[!IMPORTANT] This command is no longer in use. It is included only to preserve compatibility with existing MS-DOS files, but it has no effect at the command line because the functionality is automatic.
Sets or clears extended CTRL+C checking on MS-DOS systems. If used without parameters, break displays the existing setting value.
If command extensions are enabled and running on the Windows platform, inserting the break command into a batch file enters a hard-coded breakpoint if being debugged by a debugger.
break=[on|off]
[!NOTE] Because the break command has no effect, it is often used to create empty files or delete the content of an existing file. For example:
rem -- cleans the content of the file --
break>log
Extracts files from a cabinet or source.
[!NOTE] On Windows Server 2016 and newer, and on Windows 10, the program file Extract.exe is neither provided nor supported. It is replaced by Extrac32.exe, originally part of Internet Explorer, now part of the operating system.
extract [/y] [/a] [/d | /e] [/l dir] cabinet [filename ...]
extract [/y] source [newname]
extract [/y] /c source destination
Parameter | Description |
---|---|
cabinet | Use if you want to extract two or more files. |
filename | Name of the file to extract from the cabinet. Wild cards and multiple filenames (separated by blanks) may be used. |
source | Compressed file (a cabinet with only one file). |
newname | New filename to give the extracted file. If not supplied, the original name is used. |
/a | Process ALL cabinets. Follows cabinet chain starting in first cabinet mentioned. |
/c | Copy source file to destination (to copy from DMF disks). |
/d | Display cabinet directory (use with filename to avoid extract). |
/e | Extract (use instead of . to extract all files). |
/l dir | Location to place extracted files (default is current directory). |
/y | Don't prompt before overwriting an existing file. |
[!NOTE] Extrac32.exe can be used from the command line, but does not display any output on the console. Redirect the help output through the more command, like this:
extrac32.exe /? | more
Extrac32 [/Y] [/A] [/D | /E] [/L dir] cabinet [filename ...]
Extrac32 [/Y] source [newname]
Extrac32 [/Y] /C source destination
Parameter | Description |
---|---|
cabinet | Cabinet file (contains two or more files). |
filename | Name of the file to extract from the cabinet. Wild cards and multiple filenames (separated by blanks) may be used. |
source | Compressed file (a cabinet with only one file). |
newname | New filename to give the extracted file. If not supplied, the original name is used. |
/A | Process ALL cabinets. Follows cabinet chain starting in first cabinet mentioned. |
/C | Copy source file to destination (to copy from DMF disks). |
/D | Display cabinet directory (use with filename to avoid extract). |
/E | Extract (use instead of . to extract all files). |
/L dir | Location to place extracted files (default is current directory). |
/Y | Do not prompt before overwriting an existing file. |
Converts a basic disk into a dynamic disk. A basic disk must be selected for this operation to succeed. Use the select disk command to select a basic disk and shift the focus to it.
[!NOTE] For instructions regarding how to use this command, see Change a Dynamic Disk Back to a Basic Disk).
convert dynamic [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To convert a basic disk into a dynamic disk, type:
convert dynamic
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Expands one or more compressed files. You can also use this command to retrieve compressed files from distribution disks.
The expand command can also run from the Windows Recovery Console, using different parameters. For more information, see Windows Recovery Environment (WinRE).
expand [/r] <source> <destination>
expand /r <source> [<destination>]
expand /i <source> [<destination>]
expand /d <source>.cab [/f:<files>]
expand <source>.cab /f:<files> <destination>
Parameter | Description | |
---|---|---|
/r | Renames expanded files. | |
source | Specifies the files to expand. Source can consist of a drive letter and colon, a directory name, a file name, or a combination of these. You can use wildcards (* or ?). | |
destination | Specifies where files are to be expanded. If source consists of multiple files and you don't specify /r, the destination must be a directory. Destination can consist of a drive letter and colon, a directory name, a file name, or a combination of these. Destination `file |
path` specification. |
/i | Renames expanded files but ignores the directory structure. | |
/d | Displays a list of files in the source location. Doesn't expand or extract the files. | |
/f:<files> |
Specifies the files in a cabinet (.cab) file that you want to expand. You can use wildcards (* or ?). | |
/? | Displays help at the command prompt. |
Displays messages or turns on or off the command echoing feature. If used without parameters, echo displays the current echo setting.
echo [<message>]
echo [on | off]
Parameter | Description |
---|---|
[on | off] | Turns on or off the command echoing feature. Command echoing is on by default. |
<message> |
Specifies the text to display on the screen. |
/? | Displays help at the command prompt. |
The echo <message>
command is particularly useful when echo is turned off. To display a message that is several lines long without displaying any commands, you can include several echo <message>
commands after the echo off command in your batch program.
After echo is turned off, the command prompt doesn't appear in the Command Prompt window. To display the command prompt, type echo on.
If used in a batch file, echo on and echo off don't affect the setting at the command prompt.
To prevent echoing a particular command in a batch file, insert an @
sign in front of the command. To prevent echoing all commands in a batch file, include the echo off command at the beginning of the file.
To display a pipe (|
) or redirection character (<
or >
) when you are using echo, use a caret (^
) immediately before the pipe or redirection character. For example, ^|
, ^>
, or ^<
). To display a caret, type two carets in succession (^^
).
To display the current echo setting, type:
echo
To echo a blank line on the screen, type:
echo.
[!NOTE] Don't include a space before the period. Otherwise, the period appears instead of a blank line.
To prevent echoing commands at the command prompt, type:
echo off
[!NOTE] When echo is turned off, the command prompt doesn't appear in the Command Prompt window. To display the command prompt again, type echo on.
To prevent all commands in a batch file (including the echo off command) from displaying on the screen, on the first line of the batch file type:
@echo off
You can use the echo command as part of an if statement. For example, to search the current directory for any file with the .rpt file name extension, and to echo a message if such a file is found, type:
if exist *.rpt echo The report has arrived.
The following batch file searches the current directory for files with the .txt file name extension, and displays a message indicating the results of the search:
@echo off
if not exist *.txt (
echo This directory contains no text files.
) else (
echo This directory contains the following text files:
echo.
dir /b *.txt
)
If no .txt files are found when the batch file is run, the following message displays:
This directory contains no text files.
If .txt files are found when the batch file is run the following output displays (for this example, assume the files File1.txt, File2.txt, and File3.txt exist):
This directory contains the following text files:
File1.txt
File2.txt
File3.txt
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.
date [/t | <month-day-year>]
Parameter | Description |
---|---|
<month-day-year> |
Sets the date specified, where month is the month (one or two digits, including values 1 through 12), day is the day (one or two digits, including values 1 through 31), and year is the year (two or four digits, including the values 00 through 99 or 1980 through 2099). You must separate values for month, day, and year with periods (.), hyphens (-), or slash marks (/). Note: Be aware that if you use 2 digits to represent the year, the values 80-99 correspond to 1980 through 1999. |
/t | Displays the current date without prompting you for a new date. |
/? | Displays help at the command prompt. |
If command extensions are enabled, to display the current system date, type:
date /t
To change the current system date to August 3, 2007, you can type any of the following:
date 08.03.2007
date 08-03-07
date 8/3/07
To display the current system date, followed by a prompt to enter a new date, type:
The current date is: Mon 04/02/2007
Enter the new date: (mm-dd-yyyy)
To keep the current date and return to the command prompt, press ENTER. To change the current date, type the new date and then press ENTER.
The eventquery command has been deprecated and isn't guaranteed to be supported in future releases of Windows.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Checks the configuration of a Distributed File System (DFS) namespace by performing the following actions:
Verifies that the DFS Namespace service is running and that its startup type is set to Automatic on all namespace servers.
Verifies that the DFS registry configuration is consistent among namespace servers.
Validates the following dependencies on clustered namespace servers:
Namespace root resource dependency on network name resource.
Network name resource dependency on IP address resource.
Namespace root resource dependency on physical disk resource.
dfsdiag /testdfsconfig /DFSroot:<namespace>
Parameter | Description |
---|---|
/DFSroot:<namespace> |
The namespace (DFS root) to diagnose. |
To verify the configuration of Distributed File System (DFS) namespaces in contoso.com\MyNamespace, type:
dfsdiag /testdfsconfig /DFSroot:\\contoso.com\MyNamespace
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays the properties of the selected virtual hard disk (VHD). Before you begin, you must select a VHD for this operation to succeed. Use the select vdisk command to select a VHD and shift the focus to it.
detail vdisk
To see details about the selected VHD, type:
detail vdisk
Deletes shadow copies.
delete shadows [all | volume <volume> | oldest <volume> | set <setID> | id <shadowID> | exposed {<drive> | <mountpoint>}]
Parameter | Description |
---|---|
all | Deletes all shadow copies. |
volume <volume> |
Deletes all shadow copies of the given volume. |
oldest <volume> |
Deletes the oldest shadow copy of the given volume. |
set <setID> |
Deletes the shadow copies in the Shadow Copy Set of the given ID. You can specify an alias by using the % symbol if the alias exists in the current environment. |
id <shadowID> |
Deletes a shadow copy of the given ID. You can specify an alias by using the % symbol if the alias exists in the current environment. |
exposed {<drive> | <mountpoint> } |
Deletes shadow copies exposed at the specified drive or mount point. |
Deletes a missing dynamic disk from the list of disks.
[!NOTE] For detailed instructions about how to use this command, see Remove a Missing Dynamic Disk.
delete disk [noerr] [override]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
override | Enables DiskPart to delete all simple volumes on the disk. If the disk contains half of a mirrored volume, the half of the mirror on the disk is deleted. The delete disk override command fails if the disk is a member of a RAID-5 volume. |
To delete a missing dynamic disk from the list of disks, type:
delete disk
Changes the active console code page. If used without parameters, chcp displays the number of the active console code page.
chcp [<nnn>]
Parameter | Description |
---|---|
<nnn> |
Specifies the code page. |
/? | Displays help at the command prompt. |
The following table lists each supported code page and its country/region or language:
Code page | Country/region or language |
---|---|
437 | United States |
850 | Multilingual (Latin I) |
852 | Slavic (Latin II) |
855 | Cyrillic (Russian) |
857 | Turkish |
860 | Portuguese |
861 | Icelandic |
863 | Canadian-French |
865 | Nordic |
866 | Russian |
869 | Modern Greek |
936 | Chinese |
Only the original equipment manufacturer (OEM) code page that is installed with Windows appears correctly in a Command Prompt window that uses Raster fonts. Other code pages appear correctly in full-screen mode or in Command Prompt windows that use TrueType fonts.
You don't need to prepare code pages (as in MS-DOS).
Programs that you start after you assign a new code page use the new code page. However, programs (except Cmd.exe) that you started before assigning the new code page will continue to use the original code page.
To view the active code page setting, type:
chcp
A message similar to the following appears: Active code page: 437
To change the active code page to 850 (Multilingual), type:
chcp 850
If the specified code page is invalid, the following error message appears: Invalid code page
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes Remote Desktop Session Host server settings for logons, COM port mappings, and install mode.
[!NOTE] To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server.
change logon
change port
change user
Parameter | Description |
---|---|
change logon command | Enables or disables logons from client sessions on an Remote Desktop Session Host server, or displays current logon status. |
change port command | Lists or changes the COM port mappings to be compatible with MS-DOS applications. |
change user command | Changes the install mode for the Remote Desktop Session Host server. |
Disassociates a shadow copy volume from VSS and makes it accessible as a regular volume. The volume can then be accessed using a drive letter (if assigned) or volume name. If used without parameters, break displays help at the command prompt.
[!NOTE] This command is relevant only for hardware shadow copies after import.
Exposed volumes, like the shadow copies they originate from, are read-only by default. Access to the volume is made directly to the hardware provider without record of the volume having been a shadow copy.
break [writable] <setid>
Parameter | Description |
---|---|
[writable] | Enables read/write access on the volume. |
<setid> | Specifies the ID of the shadow copy set. The alias of the shadow copy ID, which is stored as an environment variable by the load metadata command, can be used in the SetID parameter. |
To make a shadow copy using the alias name Alias1 accessible as a writable volume in the operating system:
break writable %Alias1%
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Deletes an operating system entry in the [operating systems] section of the Boot.ini file.
bootcfg /delete [/s <computer> [/u <domain>\<user> /p <password>]] [/id <osentrylinenum>]
Parameter | Description |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (don't use backslashes). The default is the local computer. |
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by <user> or <domain>\<user> . The default is the permissions of the current logged on user on the computer issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
/id <osentrylinenum> |
Specifies the operating system entry line number in the [operating systems] section of the Boot.ini file to which the operating system load options are added. The first line after the [operating systems] section header is 1. |
/? | Displays help at the command prompt. |
To use the bootcfg /delete command:
bootcfg /delete /id 1
bootcfg /delete /s srvmain /u maindom\hiropln /p p@ssW23 /id 3
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Configures 1394 port debugging for a specified operating system entry.
bootcfg /dbg1394 {on | off}[/s <computer> [/u <domain>\<user> /p <password>]] [/ch <channel>] /id <osentrylinenum>
Parameter | Description | |
---|---|---|
`{on | off}` | Specifies the value for 1394 port debugging, including:
|
/s <computer> |
Specifies the name or IP address of a remote computer (don't use backslashes). The default is the local computer. | |
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by <user> or <domain>\<user> . The default is the permissions of the current logged on user on the computer issuing the command. |
|
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. | |
/ch <channel> |
Specifies the channel to use for debugging. Valid values include integers, between 1 and 64. Don't use this parameter if 1394 port debugging is disabled. | |
/id <osentrylinenum> |
Specifies the operating system entry line number in the [operating systems] section of the Boot.ini file to which the operating system load options are added. The first line after the [operating systems] section header is 1. | |
/? | Displays help at the command prompt. |
To use the bootcfg /dbg1394command:
bootcfg /dbg1394 /id 2
bootcfg /dbg1394 on /ch 1 /id 3
bootcfg /dbg1394 edit /ch 8 /id 2
bootcfg /s srvmain /u maindom\hiropln /p p@ssW23 /dbg1394 off /id 2
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Makes a copy of an existing boot entry, to which you can add command-line options.
bootcfg /copy [/s <computer> [/u <domain>\<user> /p <password>]] [/d <description>] [/id <osentrylinenum>]
Parameter | Description |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (don't use backslashes). The default is the local computer. |
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by <user> or <domain>\<user> . The default is the permissions of the current logged on user on the computer issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
/d <description> |
Specifies the description for the new operating system entry. |
/id <osentrylinenum> |
Specifies the operating system entry line number in the [operating systems] section of the Boot.ini file to which the operating system load options are added. The first line after the [operating systems] section header is 1. |
/? | Displays help at the command prompt. |
To copy boot entry 1 and enter \ABC Server as the description:
bootcfg /copy /d \ABC Server\ /id 1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Configures, queries, or changes Boot.ini file settings.
bootcfg <parameter> [arguments...]
Parameter | Description |
---|---|
bootcfg addsw | Adds operating system load options for a specified operating system entry. |
bootcfg copy | Makes a copy of an existing boot entry, to which you can add command-line options. |
bootcfg dbg1394 | Configures 1394 port debugging for a specified operating system entry. |
bootcfg debug | Adds or changes the debug settings for a specified operating system entry. |
bootcfg default | Specifies the operating system entry to designate as the default. |
bootcfg delete | Deletes an operating system entry in the [operating systems] section of the Boot.ini file. |
bootcfg ems | Enables the user to add or change the settings for redirection of the Emergency Management Services console to a remote computer. |
bootcfg query | Queries and displays the [boot loader] and [operating systems] section entries from Boot.ini. |
bootcfg raw | Adds operating system load options specified as a string to an operating system entry in the [operating systems] section of the Boot.ini file. |
bootcfg rmsw | Removes operating system load options for a specified operating system entry. |
bootcfg timeout | Changes the operating system time-out value. |
Displays the version of BITS service (for example, 2.0).
[!NOTE] This command isn't supported by BITS 1.5 and earlier.
bitsadmin /util /version [/verbose]
Parameter | Description |
---|---|
/verbose | Use this switch to display the file version for each BITS-related DLL and to verify whether the BITS service can start. |
To display the version of the BITS Service.
bitsadmin /util /version
Specifies the path of the file that contains the server upload-reply.
[!NOTE] This command isn't supported by BITS 1.2 and earlier.
bitsadmin /setreplyfilename <job> <file_path>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
file_path | Location to put the server upload-reply. |
To set the upload-reply filename file path for the job named myDownloadJob:
bitsadmin /setreplyfilename myDownloadJob c:\upload-reply
Sets the proxy settings for the specified job.
bitsadmin /setproxysettings <job> <usage> [list] [bypass]
Parameter | Description |
---|---|
job | The job's display name or GUID. |
usage | Sets the proxy usage, including:
|
list | Used when the Usage parameter is set to OVERRIDE. Must contain a comma-delimited list of proxy servers to use. |
bypass | Used when the Usage parameter is set to OVERRIDE. Must contain a space-delimited list of host names or IP addresses, or both, for which transfers are not to be routed through a proxy. This can be <local> to refer to all servers on the same LAN. Values of NULL may be used for an empty proxy bypass list. |
To set the proxy settings using the various usage options for the job named myDownloadJob:
bitsadmin /setproxysettings myDownloadJob PRECONFIG
bitsadmin /setproxysettings myDownloadJob NO_PROXY
bitsadmin /setproxysettings myDownloadJob OVERRIDE proxy1:80
bitsadmin /setproxysettings myDownloadJob OVERRIDE proxy1,proxy2,proxy3 NULL
Sets the length of time, in seconds, that BITS tries to transfer the file after the first transient error occurs.
bitsadmin /setnoprogresstimeout <job> <timeoutvalue>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
timeoutvalue | The length of time that BITS waits to transfer a file after the first error, in seconds. |
The "no progress" timeout interval begins when the job encounters its first transient error.
The timeout interval stops or resets when a byte of data is successfully transferred.
If the "no progress" timeout interval exceeds the timeoutvalue, then the job is placed in a fatal error state.
To set the "no progress" timeout value to 20 seconds, for the job named myDownloadJob:
bitsadmin /setnoprogresstimeout myDownloadJob 20
Sets the access control list (ACL) propagations flags for the job. The flags indicate that you want to maintain the owner and ACL information with the file being downloaded. For example, to maintain the owner and group with the file, set the flags parameter to og
.
bitsadmin /setaclflag <job> <flags>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
flags | Specify one or more of the values, including:
|
To set the access control list propagation flags for the job named myDownloadJob, so it maintains the owner and group information with the downloaded files.
bitsadmin /setaclflags myDownloadJob og
Adds credentials to a job.
[!NOTE] This command isn't supported by BITS 1.2 and earlier.
bitsadmin /setcredentials <job> <target> <scheme> <username> <password>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
target | Use either SERVER or PROXY. |
scheme | Use one of the following:
|
user_name | The name of the user. |
password | The password associated with the provided Username. |
To add credentials to the job named myDownloadJob:
bitsadmin /setcredentials myDownloadJob SERVER BASIC Edward password20
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message Protocol (ICMP) echo Request messages. The receipt of corresponding echo Reply messages are displayed, along with round-trip times. ping is the primary TCP/IP command used to troubleshoot connectivity, reachability, and name resolution. Used without parameters, this command displays Help content.
You can also use this command to test both the computer name and the IP address of the computer. If pinging the IP address is successful, but pinging the computer name isn't, you might have a name resolution problem. In this case, make sure the computer name you are specifying can be resolved through the local Hosts file, by using Domain Name System (DNS) queries, or through NetBIOS name resolution techniques.
[!NOTE] This command is available only if the Internet Protocol (TCP/IP) is installed as a component in the properties of a network adapter in Network Connections.
ping [/t] [/a] [/n <count>] [/l <size>] [/f] [/I <TTL>] [/v <TOS>] [/r <count>] [/s <count>] [{/j <hostlist> | /k <hostlist>}] [/w <timeout>] [/R] [/S <Srcaddr>] [/4] [/6] <targetname>
Parameter | Description |
---|---|
/t | Specifies ping continue sending echo Request messages to the destination until interrupted. To interrupt and display statistics, press CTRL+ENTER. To interrupt and quit this command, press CTRL+C. |
/a | Specifies reverse name resolution be performed on the destination IP address. If this is successful, ping displays the corresponding host name. |
/n <count> |
Specifies the number of echo Request messages be sent. The default is 4. |
/l <size> |
Specifies the length, in bytes, of the Data field in the echo Request messages. The default is 32. The maximum size is 65,527. |
/f | Specifies that echo Request messages are sent with the Do not Fragment flag in the IP header set to 1 (available on IPv4 only). The echo Request message can't be fragmented by routers in the path to the destination. This parameter is useful for troubleshooting path Maximum Transmission Unit (PMTU) problems. |
/I <TTL> |
Specifies the value of the Time To Live (TTL) field in the IP header for echo Request messages sent. The default is the default TTL value for the host. The maximum TTL is 255. |
/v <TOS> |
Specifies the value of the Type Of Service (TOS) field in the IP header for echo Request messages sent (available on IPv4 only). The default is 0. TOS is specified as a decimal value from 0 through 255. |
/r <count> |
Specifies the Record Route option in the IP header is used to record the path taken by the echo Request message and corresponding echo Reply message (available on IPv4 only). Each hop in the path uses an entry in the Record Route option. If possible, specify a count equal to or greater than the number of hops between the source and destination. The count must be a minimum of 1 and a maximum of 9. |
/s <count> |
Specifies that the Internet timestamp option in the IP header is used to record the time of arrival for the echo Request message and corresponding echo Reply message for each hop. The count must be a minimum of 1 and a maximum of 4. This is required for link-local destination addresses. |
/j <hostlist> |
Specifies the echo Request messages use the Loose Source Route option in the IP header with the set of intermediate destinations specified in hostlist (available on IPv4 only). With loose source routing, successive intermediate destinations can be separated by one or multiple routers. The maximum number of addresses or names in the host list is 9. The host list is a series of IP addresses (in dotted decimal notation) separated by spaces. |
/k <hostlist> |
Specifies the echo Request messages use the Strict Source Route option in the IP header with the set of intermediate destinations specified in hostlist (available on IPv4 only). With strict source routing, the next intermediate destination must be directly reachable (it must be a neighbor on an interface of the router). The maximum number of addresses or names in the host list is 9. The host list is a series of IP addresses (in dotted decimal notation) separated by spaces. |
/w <timeout> |
Specifies the amount of time, in milliseconds, to wait for the echo Reply message corresponding to a given echo Request message. If the echo Reply message is not received within the time-out, the "Request timed out" error message is displayed. The default time-out is 4000 (4 seconds). |
/R | Specifies the round-trip path is traced (available on IPv6 only). |
/S <Srcaddr> |
Specifies the source address to use (available on IPv6 only). |
/4 | Specifies IPv4 used to ping. This parameter is not required to identify the target host with an IPv4 address. It is only required to identify the target host by name. |
/6 | Specifies IPv6 used to ping. This parameter is not required to identify the target host with an IPv6 address. It is only required to identify the target host by name. |
<targetname> |
Specifies the host name or IP address of the destination. |
/? | Displays help at the command prompt. |
C:\>ping example.microsoft.com
pinging example.microsoft.com [192.168.239.132] with 32 bytes of data:
Reply from 192.168.239.132: bytes=32 time=101ms TTL=124
Reply from 192.168.239.132: bytes=32 time=100ms TTL=124
Reply from 192.168.239.132: bytes=32 time=120ms TTL=124
Reply from 192.168.239.132: bytes=32 time=120ms TTL=124
To ping the destination 10.0.99.221 and resolve 10.0.99.221 to its host name, type:
ping /a 10.0.99.221
To ping the destination 10.0.99.221 with 10 echo Request messages, each of which has a Data field of 1000 bytes, type:
ping /n 10 /l 1000 10.0.99.221
To ping the destination 10.0.99.221 and record the route for 4 hops, type:
ping /r 4 10.0.99.221
To ping the destination 10.0.99.221 and specify the loose source route of 10.12.0.1-10.29.3.1-10.1.44.1, type:
ping /j 10.12.0.1 10.29.3.1 10.1.44.1 10.0.99.221
Specifies the identifier of the client certificate to use for client authentication in an HTTPS (SSL) request.
bitsadmin /setclientcertificatebyid <job> <store_location> <store_name> <hexadecimal_cert_id>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
store_location | Identifies the location of a system store to use for looking up the certificate, including:
|
store_name | The name of the certificate store, including:
|
hexadecimal_cert_id | A hexadecimal number representing the hash of the certificate. |
To specify the identifier of the client certificate to use for client authentication in an HTTPS (SSL) request for the job named myDownloadJob:
bitsadmin /setclientcertificatebyid myDownloadJob BG_CERT_STORE_LOCATION_CURRENT_USER MY A106B52356D3FBCD1853A41B619358BD
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2
[!IMPORTANT] This command has been deprecated.
Detects floating point division error (if present) in the Pentium chip, disables floating point hardware, and turns on floating point emulation. For descriptions and usage information, see pentnt.
Enables an administrator to query, display, or disconnect files and directories that have been opened on a system. This command also enables or disables the system Maintain Objects List global flag.
Enables an administrator to disconnect files and folders that have been opened remotely through a shared folder.
openfiles /disconnect [/s <system> [/u [<domain>\]<username> [/p [<password>]]]] {[/id <openfileID>] | [/a <accessedby>] | [/o {read | write | read/write}]} [/op <openfile>]
Parameter | Description | ||
---|---|---|---|
/s <system> |
Specifies the remote system to connect to (by name or IP address). Don't use backslashes. If you don't use the /s option, the command is run on the local computer by default. This parameter applies to all files and folders that are specified in the command. | ||
/u [<domain>\]<username> |
Runs the command using the permissions of the specified user account. If you don't use the /u option, system permissions are used by default. | ||
/p [<password>] |
Specifies the password of the user account that is specified in the /u option. If you don't use the /p option, a password prompt appears when the command is run. | ||
/id <openfileID> |
Disconnects open files by the specified file ID. You can use the wildcard character (*) with this parameter. Note: You can use the openfiles /query command to find the file ID. |
||
/a <accessedby> |
Disconnects all open files associated with the user name specified in the accessedby parameter. You can use the wildcard character (*) with this parameter. | ||
/o `{read | write | read/write}` | Disconnects all open files with the specified open mode value. Valid values are Read, Write, or Read/Write. You can use the wildcard character (*) with this parameter. |
/op <openfile> |
Disconnects all open file connections that are created by a specific open file name. You can use the wildcard character (*) with this parameter. | ||
/? | Displays help at the command prompt. |
To disconnect all open files with the file ID 26843578, type:
openfiles /disconnect /id 26843578
To disconnect all open files and directories accessed by the user hiropln, type:
openfiles /disconnect /a hiropln
To disconnect all open files and directories with read/write mode, type:
openfiles /disconnect /o read/write
To disconnect the directory with the open file name *C:\testshare*, regardless of who is accessing it, type:
openfiles /disconnect /a * /op c:\testshare\
To disconnect all open files on the remote computer srvmain that are being accessed by the user hiropln, regardless of their ID, type:
openfiles /disconnect /s srvmain /u maindom\hiropln /id *
Queries and displays all open files.
openfiles /query [/s <system> [/u [<domain>\]<username> [/p [<password>]]]] [/fo {TABLE | LIST | CSV}] [/nh] [/v]
Parameter | Description | ||
---|---|---|---|
/s <system> |
Specifies the remote system to connect to (by name or IP address). Don't use backslashes. If you don't use the /s option, the command is run on the local computer by default. This parameter applies to all files and folders that are specified in the command. | ||
/u [<domain>\]<username> |
Runs the command using the permissions of the specified user account. If you don't use the /u option, system permissions are used by default. | ||
/p [<password>] |
Specifies the password of the user account that is specified in the /u option. If you don't use the /p option, a password prompt appears when the command is run. | ||
[/fo `{TABLE | LIST | CSV}`] | Displays the output in the specified format. Valid values include:
|
/nh | Suppresses column headers in the output. Valid only when the /fo parameter is set to TABLE or CSV. | ||
/v | Specifies that detailed (verbose) information be displayed in the output. | ||
/? | Displays help at the command prompt. |
To query and display all open files, type:
openfiles /query
To query and display all open files in table format without headers, type:
openfiles /query /fo table /nh
To query and display all open files in list format with detailed information, type:
openfiles /query /fo list /v
To query and display all open files on the remote system srvmain by using the credentials for the user hiropln on the maindom domain, type:
openfiles /query /s srvmain /u maindom\hiropln /p p@ssW23
[!NOTE] In this example, the password is supplied on the command line. To prevent displaying the password, leave out the /p option. You'll be prompted for the password, which won't be echoed to the screen.
Enables or disables the system Maintain Objects List global flag. If used without parameters, openfiles /local displays the current status of the Maintain Objects List global flag.
[!NOTE] Changes made by using the on or off option don't take effect until you restart the system. Enabling the Maintain Objects List global flag might slow down your system.
openfiles /local [on | off]
Parameter | Description | |
---|---|---|
`[on | off]` | Enables or disables the system Maintain Objects List global flag, which tracks local file handles. |
/? | Displays help at the command prompt. |
To check the current status of the Maintain Objects List global flag, type:
openfiles /local
By default, the Maintain Objects List global flag is disabled, and the following message appears, INFO: The system global flag 'maintain objects list' is currently disabled.
To enable the Maintain Objects List global flag, type:
openfiles /local on
The following message appears when the global flag is enabled, SUCCESS: The system global flag 'maintain objects list' is enabled. This will take effect after the system is restarted.
To disable the Maintain Objects List global flag, type:
openfiles /local off
Returns data suitable for parsing. Typically, you use this command in conjunction with the /create and /get* switches to receive only the value. You must specify this switch before other switches.
[!NOTE] This command strips newline characters and formatting from the output.
bitsadmin /rawreturn
To retrieve the raw data for the state of the job named myDownloadJob:
bitsadmin /rawreturn /getstate myDownloadJob
Sets the command path in the PATH environment variable, specifying the set of directories used to search for executable (.exe) files. If used without parameters, this command displays the current command path.
path [[<drive>:]<path>[;...][;%PATH%]]
path ;
Parameter | Description |
---|---|
[<drive>:]<path> |
Specifies the drive and directory to set in the command path. The current directory is always searched before the directories specified in the command path. |
; | Separates directories in the command path. If used without other parameters, ; clears the existing command paths from the PATH environment variable and directs Cmd.exe to search only in the current directory. |
%PATH% |
Appends the command path to the existing set of directories listed in the PATH environment variable. If you include this parameter, Cmd.exe replaces it with the command path values found in the PATH environment variable, eliminating the need to manually enter these values at the command prompt. |
/? | Displays help at the command prompt. |
The Windows operating system searches using default file name extensions in the following order of precedence: .exe, .com, .bat, and .cmd. Which means if you're looking for a batch file named, acct.bat, but have an app named acct.exe in the same directory, you must include the .bat extension at the command prompt.
If two or more files in the command path have the same file name and extension, this command first searches for the specified file name in the current directory. Then, it searches the directories in the command path in the order that they're listed in the PATH environment variable.
If you place the path command in your Autoexec.nt file, the Windows operating system automatically appends the specified MS-DOS subsystem search path every time you log on to your computer. Cmd.exe does not use the Autoexec.nt file. When started from a shortcut, Cmd.exe inherits the environment variables set in My Computer/Properties/Advanced/Environment.
To search the paths c:\user\taxes, b:\user\invest, and b:\bin for external commands, type:
path c:\user\taxes;b:\user\invest;b:\bin
Takes the offline volume to the online state. This command works on volumes that have failed, are failing, or are in failed redundancy state.
[!NOTE] A volume must be selected for the online volume command to succeed. Use the select volume command to select a volume and shift the focus to it.
[!IMPORTANT] This command will fails if it's used on a read-only disk.
online volume [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To take the volume with focus online, type:
online volume
Takes the offline disk to the online state. For basic disks, this command attempts to bring online the selected disk and all volumes on that disk. For dynamic disks, this command attempts to bring online all disks that are not marked as foreign on the local computer. It also attempts to bring online all volumes on the set of dynamic disks.
If a dynamic disk in a disk group is brought online and it's the only disk in the group, then the original group is recreated and the disk is moved to that group. If there are other disks in the group and they're online, then the disk is simply added back into the group. If the group of a selected disk contains mirrored or RAID-5 volumes, this command also resynchronizes these volumes.
[!NOTE] A disk must be selected for the online disk command to succeed. Use the select disk command to select a disk and shift the focus to it.
[!IMPORTANT] This command will fails if it's used on a read-only disk.
online disk [noerr]
For instructions about using this command, see Reactivate a Missing or Offline Dynamic Disk.
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To take the disk with focus online, type:
online disk
Lists all peers.
bitsadmin /peers /list
To list all peers:
bitsadmin /peers /list
Clears the peer list.
bitsadmin /peers /clear
To clears the peer list.
bitsadmin /peers /clear
Takes the online disk with focus to the offline state. If a dynamic disk in a disk group is taken offline, the status of the disk changes to missing and the group shows a disk that's offline. The missing disk is moved to the invalid group. If the dynamic disk is the last disk in the group, then the status of the disk changes to offline, and the empty group is removed.
[!NOTE] A disk must be selected for the offline disk command to succeed. Use the select disk command to select a disk and shift the focus to it.
This command also works on disks in SAN online mode by changing the SAN mode to offline.
offline disk [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To take the disk with focus offline, type:
offline disk
Make a job's Custom HTTP Headers write-only.
[!IMPORTANT] This action can't be undone.
bitsadmin /makecustomheaderswriteonly <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To make Custom HTTP Headers write-only for the job named myDownloadJob:
bitsadmin /makecustomheaderswriteonly myDownloadJob
Backs up and restores your computer and files from a command prompt. This command has been replaced by the wbadmin command.
[!IMPORTANT] The wbadmin command can't recover backups created using the ntbackup command. However, a version of ntbackup is available as a download from Windows NT Backup - Restore Utility. This downloadable version helps you to perform recoveries of legacy backups, but it can't create new backups.
Truncates any line of output text extending beyond the right-most edge of the command window. By default, all switches, except the monitor switch, wrap the output. Specify the nowrap switch before other switches.
bitsadmin /nowrap
To retrieve the state for the job named myDownloadJob while not wrapping the output:
bitsadmin /nowrap /getstate myDownloadJob
Specifies whether to use a virtual circuit when sending requests to the server.
set [no]vc
Parameter | Description |
---|---|
novc | Specifies to never use a virtual circuit when sending requests to the server. This is the default value. |
vc | Specifies to always use a virtual circuit when sending requests to the server. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sorts and lists the output of the previous ls commands or subcommands.
view <filename>
Parameter | Description |
---|---|
<filename> |
Specifies the name of the file containing output from the previous ls commands or subcommands. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Appends the Domain Name System (DNS) domain names in the DNS domain search list to the request until an answer is received. This applies when the set and the lookup request contain at least one period, but do not end with a trailing period.
set [no]search
Parameter | Description |
---|---|
nosearch | Stops appending the Domain Name System (DNS) domain names in the DNS domain search list for the request. |
search | Appends the Domain Name System (DNS) domain names in the DNS domain search list for the request until an answer is received. This is the default value. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Lists the files in the specified job.
bitsadmin /listfiles <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the list of files for the job named myDownloadJob:
bitsadmin /listfiles myDownloadJob
Retrieves the job type of the specified job.
bitsadmin /gettype <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
The returned output values can be:
Type | Description |
---|---|
Download | The job is a download. |
Upload | The job is an upload. |
Upload-Reply | The job is an upload-reply. |
Unknown | The job has an unknown type. |
To retrieve the job type for the job named myDownloadJob:
bitsadmin /gettype myDownloadJob
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Removes all partitions or volume formatting from the disk with focus.
[!NOTE] For a PowerShell version of this command, see clear-disk command.
clean [all]
Parameter | Description |
---|---|
all | Specifies that each and every sector on the disk is set to zero, which completely deletes all data contained on the disk. |
On master boot record (MBR) disks, only the MBR partitioning information and hidden sector information is overwritten.
On GUID Partition Table (gpt) disks, the gpt partitioning information, including the Protective MBR, is overwritten. There is no hidden sector information.
A disk must be selected for this operation to succeed. Use the select disk command to select a disk and shift the focus to it.
To remove all formatting from the selected disk, type:
clean
Displays a list of a directory's files and subdirectories. If used without parameters, this command displays the disk's volume label and serial number, followed by a list of directories and files on the disk (including their names and the date and time each was last modified). For files, this command displays the name extension and the size in bytes. This command also displays the total number of files and directories listed, their cumulative size, and the free space (in bytes) remaining on the disk.
The dir command can also run from the Windows Recovery Console, using different parameters. For more information, see Windows Recovery Environment (WinRE).
dir [<drive>:][<path>][<filename>] [...] [/p] [/q] [/w] [/d] [/a[[:]<attributes>]][/o[[:]<sortorder>]] [/t[[:]<timefield>]] [/s] [/b] [/l] [/n] [/x] [/c] [/4] [/r]
Parameter | Description |
---|---|
[<drive>:][<path>] |
Specifies the drive and directory for which you want to see a listing. |
[<filename>] |
Specifies a particular file or group of files for which you want to see a listing. |
/p | Displays one screen of the listing at a time. To see the next screen, press any key. |
/q | Displays file ownership information. |
/w | Displays the listing in wide format, with as many as five file names or directory names on each line. |
/d | Displays the listing in the same format as /w, but the files are sorted by column. |
/a[[:]<attributes> ] |
Displays only the names of those directories and files with your specified attributes. If you don't use this parameter, the command displays the names of all files except hidden and system files. If you use this parameter without specifying any attributes, the command displays the names of all files, including hidden and system files. The list of possible attributes values are:
|
/o[[:]<sortorder> ] |
Sorts the output according to sortorder, which can be any combination of the following values:
If sortorder isn't specified, dir /o lists the directories alphabetically, followed by the files, which are also sorted alphabetically. |
/t[[:]<timefield> ] |
Specifies which time field to display or to use for sorting. The available timefield values are:
|
/s | Lists every occurrence of the specified file name within the specified directory and all subdirectories. |
/b | Displays a bare list of directories and files, with no additional information. The /b parameter overrides /w. |
/l | Displays unsorted directory names and file names, using lowercase. |
/n | Displays a long list format with file names on the far right of the screen. |
/x | Displays the short names generated for non-8dot3 file names. The display is the same as the display for /n, but the short name is inserted before the long name. |
/c | Displays the thousand separator in file sizes. This is the default behavior. Use /-c to hide separators. |
/4 | Displays years in four-digit format. |
/r | Display alternate data streams of the file. |
/? | Displays help at the command prompt. |
To use multiple filename parameters, separate each file name with a space, comma, or semicolon.
You can use wildcard characters (* or ?), to represent one or more characters of a file name and to display a subset of files or subdirectories.
You can use the wildcard character, *, to substitute for any string of characters, for example:
dir *.txt
lists all files in the current directory with extensions that begin with .txt, such as .txt, .txt1, .txt_old.
dir read *.txt
lists all files in the current directory that begin with read and with extensions that begin with .txt, such as .txt, .txt1, or .txt_old.
dir read *.*
lists all files in the current directory that begin with read with any extension.
The asterisk wildcard always uses short file name mapping, so you might get unexpected results. For example, the following directory contains two files (t.txt2 and t97.txt):
C:\test>dir /x
Volume in drive C has no label.
Volume Serial Number is B86A-EF32
Directory of C:\test
11/30/2004 01:40 PM <DIR> .
11/30/2004 01:40 PM <DIR> ..
11/30/2004 11:05 AM 0 T97B4~1.TXT t.txt2
11/30/2004 01:16 PM 0 t97.txt
You might expect that typing dir t97\*
would return the file t97.txt. However, typing dir t97\*
returns both files, because the asterisk wildcard matches the file t.txt2 to t97.txt by using its short name map T97B41.TXT. Similarly, typing del t97\*
would delete both files.
You can use the question mark (?) as a substitute for a single character in a name. For example, typing dir read???.txt
lists any files in the current directory with the .txt extension that begin with read and are followed by up to three characters. This includes Read.txt, Read1.txt, Read12.txt, Read123.txt, and Readme1.txt, but not Readme12.txt.
If you use /a with more than one value in attributes, this command displays the names of only those files with all the specified attributes. For example, if you use /a with r and -h as attributes (by using either /a:r-h
or /ar-h
), this command will only display the names of the read-only files that aren't hidden.
If you specify more than one sortorder value, this command sorts the file names by the first criterion, then by the second criterion, and so on. For example, if you use /o with the e and -s parameters for sortorder (by using either /o:e-s
or /oe-s
), this command sorts the names of directories and files by extension, with the largest first, and then displays the final result. The alphabetic sorting by extension causes file names with no extensions to appear first, then directory names, and then file names with extensions.
If you use the redirection symbol (>
) to send this command's output to a file, or if you use a pipe (|
) to send this command's output to another command, you must use /a:-d
and /b to only list the file names. You can use filename with /b and /s to specify that this command is to search the current directory and its subdirectories for all file names that match filename. This command lists only the drive letter, directory name, file name, and file name extension (one path per line), for each file name it finds. Before you use a pipe to send this command's output to another command, you should set the TEMP environment variable in your Autoexec.nt file.
To display all directories one after the other, in alphabetical order, in wide format, and pausing after each screen, make sure that the root directory is the current directory, and then type:
dir /s/w/o/p
The output lists the root directory, the subdirectories, and the files in the root directory, including extensions. This command also lists the subdirectory names and the file names in each subdirectory in the tree.
To alter the preceding example so that dir displays the file names and extensions, but omits the directory names, type:
dir /s/w/o/p/a:-d
To print a directory listing, type:
dir > prn
When you specify prn, the directory list is sent to the printer that is attached to the LPT1 port. If your printer is attached to a different port, you must replace prn with the name of the correct port.
You can also redirect output of the dir command to a file by replacing prn with a file name. You can also type a path. For example, to direct dir output to the file dir.doc in the Records directory, type:
dir > \records\dir.doc
If dir.doc does not exist, dir creates it, unless the Records directory does not exist. In that case, the following message appears:
File creation error
To display a list of all the file names with the .txt extension in all directories on drive C, type:
dir c:\*.txt /w/o/s/p
The dir command displays, in wide format, an alphabetized list of the matching file names in each directory, and it pauses each time the screen fills until you press any key to continue.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a Microsoft Reserved (MSR) partition on a GUID partition table (gpt) disk. A Microsoft Reserved partition is required on every gpt disk. The size of this partition depends on the total size of the gpt disk. The size of the gpt disk must be at least 32 MB to create a Microsoft Reserved partition.
[!IMPORTANT] Be very careful when using this command. Because gpt disks require a specific partition layout, creating Microsoft Reserved partitions can cause the disk to become unreadable.
A basic gpt disk must be selected for this operation to succeed. You must use the select disk command to select a basic gpt disk and shift the focus to it.
create partition msr [size=<n>] [offset=<n>] [noerr]
Parameter | Description |
---|---|
size=<n> |
The size of the partition in megabytes (MB). The partition is at least as long in bytes as the number specified by <n> . If no size is given, the partition continues until there is no more free space in the current region. |
offset=<n> |
Specifies the offset in kilobytes (KB), at which the partition is created. The offset rounds up to completely fill whatever sector size is used. If no offset is given, the partition is placed in the first disk extent that is large enough to hold it. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
On gpt disks that are used to boot the Windows operating system, the Extensible Firmware Interface (EFI) system partition is the first partition on the disk, followed by the Microsoft Reserved partition. gpt disks that are used only for data storage do not have an EFI system partition, in which case the Microsoft Reserved partition is the first partition.
Windows doesn't mount Microsoft Reserved partitions. You cannot store data on them and you cannot delete them.
To create a Microsoft Reserved partition of 1000 megabytes in size, type:
create partition msr size=1000
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Exits the command interpreter or the current batch script.
exit [/b] [<exitcode>]
Parameter | Description |
---|---|
/b | Exits the current batch script instead of exiting Cmd.exe. If executed from outside a batch script, exits Cmd.exe. |
<exitcode> |
Specifies a numeric number. If /b is specified, the ERRORLEVEL environment variable is set to that number. If you are quitting the command interpreter, the process exit code is set to that number. |
/? | Displays help at the command prompt. |
To close the command interpreter, type:
exit
Exposes a persistent shadow copy as a drive letter, share, or mount point.
expose <shadowID> {<drive:> | <share> | <mountpoint>}
Parameter | Description |
---|---|
shadowID | Specifies the shadow ID of the shadow copy you want to expose. You can also use an existing alias or an environment variable in place of shadowID. Use add without parameters to see existing aliases. |
<drive:> |
Exposes the specified shadow copy as a drive letter (for example, p: ). |
<share> |
Exposes the specified shadow copy at a share (for example, \\machinename ). |
<mountpoint> |
Exposes the specified shadow copy to a mount point (for example, C:\shadowcopy ). |
To expose the persistent shadow copy associated with the VSS_SHADOW_1 environment variable as drive X, type:
expose %vss_shadow_1% x:
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows 10, Windows Server 2012 R2, Windows 8.1, Windows Server 2012, Windows 8
Administers and monitors NTFS self-healing repair operations. Self-healing NTFS attempts to correct corruptions of the NTFS file system online, without requiring Chkdsk.exe to be run. For more information, see Self-healing NTFS.
fsutil repair [enumerate] <volumepath> [<logname>]
fsutil repair [initiate] <volumepath> <filereference>
fsutil repair [query] <volumepath>
fsutil repair [set] <volumepath> <flags>
fsutil repair [wait][<waittype>] <volumepath>
Parameter | Description | |
---|---|---|
enumerate | Enumerates the entires of a volume's corruption log. | |
<logname> |
Can be $corrupt , the set of confirmed corruptions in the volume or $verify , a set of potential, unverified corruptions in the volume. |
|
initiate | Initiates NTFS self-healing. | |
<filereference> |
Specifies the NTFS volume-specific file ID (file reference number). The file reference includes the segment number of the file. | |
query | Queries the self-healing state of the NTFS volume. | |
set | Sets the self-healing state of the volume. | |
<flags> |
Specifies the repair method to be used when setting the self-healing state of the volume. This parameter can be set to three values:
|
|
state | Queries the corruption state of the system or for a given volume. | |
wait | Waits for repair(s) to complete. If NTFS has detected a problem on a volume on which it is performing repairs, this option allows the system to wait until the repair is complete before it runs any pending scripts. | |
`[waittype {0 | 1}]` | Indicates whether to wait for the current repair to complete or to wait for all repairs to complete. The waittype parameter can be set to the following values:
|
To enumerate the confirmed corruptions of a volume, type:
fsutil repair enumerate C: $Corrupt
To enable self-healing repair on drive C, type:
fsutil repair set c: 1
To disable self-healing repair on drive C, type:
fsutil repair set c: 0
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.
cmdkey [{/add:<targetname>|/generic:<targetname>}] {/smartcard | /user:<username> [/pass:<password>]} [/delete{:<targetname> | /ras}] /list:<targetname>
Parameters | Description |
---|---|
/add:<targetname> |
Adds a user name and password to the list. Requires the parameter of |
/generic:<targetname> |
Adds generic credentials to the list. Requires the parameter of |
/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:<username> |
Specifies the user or account name to store with this entry. If <username> isn't supplied, it will be requested. |
/pass:<password> |
Specifies the password to store with this entry. If <password> isn't supplied, it will be requested. Passwords are not displayed after they're stored. |
/delete:{<targetname> \| /ras} |
Deletes a user name and password from the list. If <targetname> is specified, that entry is deleted. If /ras is specified, the stored remote access entry is deleted. |
/list:<targetname> |
Displays the list of stored user names and credentials. If <targetname> isn't specified, all stored user names and credentials are listed. |
/? | Displays help at the command prompt. |
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
The diskperf command remotely enables or disables physical or logical disk performance counters on computers running Windows.
diskperf [-y[d|v] | -n[d|v]] [\\computername]
Option | Description |
---|---|
-y | Starts all disk performance counters when the computer restarts. |
-yd | Enables disk performance counters for physical drives when the computer restarts. |
-yv | Enables disk performance counters for logical drives or storage volumes when the computer restarts. |
-n | Disables all disk performance counters when the computer restarts. |
-nd | Disable disk performance counters for physical drives when the computer restarts. |
-nv | Disable disk performance counters for logical drives or storage volumes when the computer restarts. |
\\<computername> |
Specifies the name of the computer where you want to enable or disable disk performance counters. |
-? | Displays context sensitive help. |
Redirects the command output from the command line to the Windows clipboard. You can use this command to copy data directly into any application that can receive text from the Clipboard. You can also paste this text output into other programs.
<command> | clip
clip < <filename>
Parameter | Description |
---|---|
<command> |
Specifies a command whose output you want to send to the Windows clipboard. |
<filename> |
Specifies a file whose contents you want to send to the Windows clipboard. |
/? | Displays help at the command prompt. |
To copy the current directory listing to the Windows clipboard, type:
dir | clip
To copy the output of a program called generic.awk to the Windows clipboard, type:
awk -f generic.awk input.txt | clip
To copy the contents of a file called readme.txt to the Windows clipboard, type:
clip < readme.txt
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Expands a virtual hard disk (VHD) to a specified size.
A VHD must be selected and detached for this operation to succeed. Use the select vdisk command to select a volume and shift the focus to it.
expand vdisk maximum=<n>
| Parameter | Description |
|---------- | ----------- |
| maximum=<n>
| Specifies the new size for the VHD in megabytes (MB). |
To expand the selected VHD to 20 GB, type:
expand vdisk maximum=20000
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes configuration settings that affect how lookups function.
set all [class | d2 | debug | domain | port | querytype | recurse | retry | root | search | srchlist | timeout | type | vc] [options]
Parameter | Description |
---|---|
nslookup set all | Lists all current settings. |
nslookup set class | Changes the query class, which specifies the protocol group of the information. |
nslookup set d2 | Turns the verbose debugging mode on or off. |
nslookup set debug | Turns off debugging mode completely. |
nslookup set domain | Changes the default Domain Name System (DNS) domain name to the specified name. |
nslookup set port | Changes the default TCP/UDP Domain Name System (DNS) name server port to the specified value. |
nslookup set querytype | Changes the resource record type for the query. |
nslookup set recurse | Tells the Domain Name System (DNS) name server to query other servers if it doesn't find any information. |
nslookup set retry | Sets the number of retries. |
nslookup set root | Changes the name of the root server used for queries. |
nslookup set search | Appends the Domain Name System (DNS) domain names in the DNS domain search list to the request until an answer is received. |
nslookup set srchlist | Changes the default Domain Name System (DNS) domain name and search list. |
nslookup set timeout | Changes the initial number of seconds to wait for a reply to a lookup request. |
nslookup set type | Changes the resource record type for the query. |
nslookup set vc | Specifies whether to use a virtual circuit when sending requests to the server. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the default server to the server for the root of the Domain Name System (DNS) domain name space. Currently, the ns.nic.ddn.mil name server is used. You can change the name of the root server using the nslookup set root command.
[!NOTE] This command is the same as
lserver ns.nic.ddn.mil
.
root
Parameter | Description |
---|---|
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Displays the display name or GUID of the owner of the specified job.
bitsadmin /getowner <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To display the owner for the job named myDownloadJob:
bitsadmin /getowner myDownloadJob
Exits the nslookup command-line tool.
nslookup /exit
Parameter | Description |
---|---|
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Lists DNS domain information.
ls [<option>] <DNSdomain> [{[>] <filename>|[>>] <filename>}]
Parameter | Description |
---|---|
<option> |
The valid options include:
|
<DNSdomain> |
Specifies the DNS domain for which you want information. |
<filename> |
Specifies a file name to use for the saved output. You can use the greater than (> ) and double greater than (>> ) characters to redirect the output in the usual manner. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
The default output of this command includes computer names and their associated IP addresses.
If your output is directed to a file, hash marks are added for every 50 records received from the server.
Displays the subcommand help text.
help
?
Parameter | Description |
---|---|
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays information that you can use to diagnose Domain Name System (DNS) infrastructure. Before using this tool, you should be familiar with how DNS works. The nslookup command-line tool is available only if you have installed the TCP/IP protocol.
The nslookup command-line tool has two modes: interactive and noninteractive.
If you need to look up only a single piece of data, we recommend using the non-interactive mode. For the first parameter, type the name or IP address of the computer that you want to look up. For the second parameter, type the name or IP address of a DNS name server. If you omit the second argument, nslookup uses the default DNS name server.
If you need to look up more than one piece of data, you can use interactive mode. Type a hyphen (-) for the first parameter and the name or IP address of a DNS name server for the second parameter. If you omit both parameters, the tool uses the default DNS name server. While using the interactive mode, you can:
Interrupt interactive commands at any time, by pressing CTRL+B.
Exit, by typing exit.
Treat a built-in command as a computer name, by preceding it with the escape character (``). An unrecognized command is interpreted as a computer name.
nslookup [exit | finger | help | ls | lserver | root | server | set | view] [options]
Parameter | Description |
---|---|
nslookup exit | Exits the nslookup command-line tool. |
nslookup finger | Connects with the finger server on the current computer. |
nslookup help | Displays a short summary of subcommands. |
nslookup ls | Lists information for a DNS domain. |
nslookup lserver | Changes the default server to the specified DNS domain. |
nslookup root | Changes the default server to the server for the root of the DNS domain name space. |
nslookup server | Changes the default server to the specified DNS domain. |
nslookup set | Changes configuration settings that affect how lookups function. |
nslookup set all | Prints the current values of the configuration settings. |
nslookup set class | Changes the query class. The class specifies the protocol group of the information. |
nslookup set d2 | Turns exhaustive Debugging mode on or off. All fields of every packet are printed. |
nslookup set debug | Turns Debugging mode on or off. |
nslookup set domain | Changes the default DNS domain name to the name specified. |
nslookup set port | Changes the default TCP/UDP DNS name server port to the value specified. |
nslookup set querytype | Changes the resource record type for the query. |
nslookup set recurse | Tells the DNS name server to query other servers if it doesn't have the information. |
nslookup set retry | Sets the number of retries. |
nslookup set root | Changes the name of the root server used for queries. |
nslookup set search | Appends the DNS domain names in the DNS domain search list to the request until an answer is received. This applies when the set and the lookup request contain at least one period, but do not end with a trailing period. |
nslookup set srchlist | Changes the default DNS domain name and search list. |
nslookup set timeout | Changes the initial number of seconds to wait for a reply to a request. |
nslookup set type | Changes the resource record type for the query. |
nslookup set vc | Specifies to use or not use a virtual circuit when sending requests to the server. |
nslookup view | Sorts and lists the output of the previous ls subcommand or commands. |
If computerTofind is an IP address and the query is for an A or PTR resource record type, the name of the computer is returned.
If computerTofind is a name and doesn't have a trailing period, the default DNS domain name is appended to the name. This behavior depends on the state of the following set subcommands: domain, srchlist, defname, and search.
If you type a hyphen (-) instead of computerTofind, the command prompt changes to nslookup interactive mode.
If the lookup request fails, the command-line tool provides an error message, including:
| Error message | Description | | ------------- | ----------- | | timed out |The server didn't respond to a request after a certain amount of time and a certain number of retries. You can set the time-out period with the nslookup set timeout command. You can set the number of retries with the nslookup set retry command. | | No response from server | No DNS name server is running on the server computer. | | No records | The DNS name server doesn't have resource records of the current query type for the computer, although the computer name is valid. The query type is specified with the nslookup set querytype command. | | Nonexistent domain | The computer or DNS domain name doesn't exist. | | Connection refused or Network is unreachable | The connection to the DNS name server or finger server could not be made. This error commonly occurs with the ls and finger requests. | | Server failure | The DNS name server found an internal inconsistency in its database and could not return a valid answer. | | Refused | The DNS name server refused to service the request. | | format error | The DNS name server found that the request packet was not in the proper format. It may indicate an error in nslookup. |
Retrieves the command-line command to run after the specified job finishes transferring data.
[!NOTE] This command isn't supported by BITS 1.2 and earlier.
bitsadmin /getnotifycmdline <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the command-line command used by the service when the job named myDownloadJob completes.
bitsadmin /getnotifycmdline myDownloadJob
Retrieves the length of time, in seconds, that the service will wait after encountering a transient error before trying to transfer the file.
bitsadmin /getminretrydelay <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the minimum retry delay for the job named myDownloadJob:
bitsadmin /getminretrydelay myDownloadJob
Winpop is deprecated, and is not guaranteed to be supported in future releases of Windows.
This tool is included in Windows Server 2003. For more information, see winpop.
Measures the performance of video decoding (playback) using the Media Foundation framework.
winsat mfmedia <parameters>
Parameters | Description |
---|---|
-input <file name> | Required: Specify the file containing the video clip to be played or encoded. The file can be in any format that can be rendered by Media Foundation. |
-dumpgraph | Specify that the filter graph should be saved to a GraphEdit-compatible file before the assessment starts. |
-ns | Specify that the filter graph should run at the normal playback speed of the input file. By default, the filter graph runs as fast as possible, ignoring presentation times. |
-play | Run the assessment in decode mode and play any supplied audio content in the file specified in -input using the default DirectSound device. By default, audio playback is disabled. |
-nopmp | Do not make use of the Media Foundation Protected Media Pipeline (MFPMP) process during the assessment. |
-pmp | Always make use of the MFPMP process during the assessment.Note: If -pmp or -nopmp is not specified, MFPMP will be used only when necessary. |
-v | Send verbose output to STDOUT, including status and progress information. Any errors will also be written to the command window. |
-xml <file name> | Save the output of the assessment as the specified XML file. If the specified file exists, it will be overwritten. |
-idiskinfo | Save information about physical volumes and logical disks as part of the <SystemConfig> section in the XML output. |
-iguid | Create a globally unique identifier (GUID) in the XML output file. |
-note note text | Add the note text to the <note> section in the XML output file. |
-icn | Include the local computer name in the XML output file. |
-eef | Enumerate extra system information in the XML output file. |
winsat mfmedia -input c:\windows\performance\winsat\winsat.wmv -nopmp
Displays verbose output for a specified command. You can use /verbose with any other wdsutil commands that you run. Note that you must specify /verbose and /progress directly after wdsutil.
wdsutil /verbose <commands>
To delete approved computers from the Auto-Add database and show verbose output, type:
wdsutil /Verbose /progress /Delete-AutoAddDevices /Server:MyWDSServer /DeviceType:ApprovedDevices
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Stops all services on a Windows Deployment Services server.
wdsutil [Options] /Stop-Server [/Server:<Server name>]
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
To stop the services, type one of the following:
wdsutil /Stop-Server
wdsutil /verbose /Stop-Server /Server:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Reverts changes made to the server during the initial server configuration. This includes changes made by either the /initialize-server option or the Windows Deployment Services mmc snap-in. Note that this command resets the server to an unconfigured state. This command does not modify the contents of the remoteInstall shared folder. Rather, it resets the server's state so that you can reinitialize the server.
wdsutil [Options] /Uninitialize-Server [/Server:<Server name>]
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
To reinitialize the server, type one of the following:
wdsutil /Uninitialize-Server
wdsutil /verbose /Uninitialize-Server /Server:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sets properties and attributes for Windows Deployment Services servers, prestaged computers, images, image groups, and Transport Servers.
Subcommand | Description |
---|---|
Subcommand: set-Device | changes the attributes of a prestaged computer. A prestaged computer is a computer that has been linked to a computer account object in active directory Domain Servers (AD DS). Prestaged clients are also called known computers. |
Subcommand: set-Image | changes the attributes of an existing image. |
Subcommand: set-ImageGroup | changes the attributes of an existing image group. |
Subcommand: set-Server | Configures the settings for a Windows Deployment Services server. |
Subcommand: set-TransportServer | Configures the settings for a Transport Server. |
Subcommand: set-DriverPackage | renames and/or enable/disable a driver package on a server. |
Subcommand: set-DriverGroup | Sets the properties of an existing driver group on a server. |
Subcommand: set-DriverGroupFilter | adds or removes an existing driver group filter from a driver group. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Removes a driver package from a server.
wdsutil /remove-DriverPackage [/Server:<Server name>] {/DriverPackage:<Package Name> | /PackageId:<ID>}
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be the NetBIOS name or the FQDN. If a server name is not specified, the local server is used. |
[/DriverPackage:<Name>] | Specifies the name of the driver package to remove. |
[/PackageId:<ID>] | Specifies the Windows Deployment Services ID of the driver package to remove. You must specify the ID if the driver package cannot be uniquely identified by name. |
To view information about the images, type one of the following:
wdsutil /remove-DriverPackage /PackageId:{4D36E972-E325-11CE-Bfc1-08002BE10318}
wdsutil /remove-DriverPackage /Server:MyWdsServer /DriverPackage:MyDriverPackage
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Rejects computers that are pending administrative approval. When the Auto-add policy is enabled, administrative approval is required before unknown computers (those that are not prestaged) can install an image. You can enable this policy using the PXE Response tab of the server s properties page.
wdsutil [Options] /Reject-AutoaddDevices [/Server:<Server name>] /RequestId:<Request ID or ALL>
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
/RequestId:<Request ID | ALL> | Specifies the request ID assigned to the pending computer. To reject all pending computers, specify ALL. |
To reject a single computer, type:
wdsutil /Reject-AutoaddDevices /RequestId:12
To reject all computers, type:
wdsutil /verbose /Reject-AutoaddDevices /Server:MyWDSServer /RequestId:ALL
Adds a file to the specified job. BITS downloads the specified ranges from the remote file. This switch is valid only for download jobs.
bitsadmin /addfilewithranges <job> <remoteURL> <localname> <rangelist>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
remoteURL | URL of the file on the server. |
localname | Name of the file on the local computer. Must contain an absolute path to the file. |
rangelist | Comma-delimited list of offset:length pairs. Use a colon to separate the offset value from the length value. For example, a value of 0:100,2000:100,5000:eof tells BITS to transfer 100 bytes from offset 0, 100 bytes from offset 2000, and the remaining bytes from offset 5000 to the end of the file. |
The token eof is a valid length value within the offset and length pairs in the <rangelist>
. It instructs the service to read to the end of the specified file.
The addfilewithranges
command will fail with error code 0x8020002c, if a zero-length range is specified along with another range using same offset, such as:
c:\bits>bitsadmin /addfilewithranges j2 http://bitsdc/dload/1k.zip c:\1k.zip 100:0,100:5
Error message: Unable to add file to job - 0x8020002c. The list of byte ranges contains some overlapping ranges, which are not supported.
Workaround: Don't specify the zero-length range first. For example, use bitsadmin /addfilewithranges j2 http://bitsdc/dload/1k.zip c:\1k.zip 100:5,100:0
To transfer 100 bytes from offset 0, 100 bytes from offset 2000, and the remaining bytes from offset 5000 to the end of the file:
bitsadmin /addfilewithranges http://downloadsrv/10mb.zip c:\10mb.zip 0:100,2000:100,5000:eof
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays information about a specified Transport Server.
wdsutil [Options] /Get-TransportServer [/Server:<Server name>] /Show:{Config}
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
/Show:{Config} | Returns configuration information about the specified Transport Server. |
To view information about the server, type:
wdsutil /Get-TransportServer /Show:Config
To view configuration information, type:
wdsutil /Get-TransportServer /Server:MyWDSServer /Show:Config
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows 10
Bitsadmin is a command-line tool used to create, download or upload jobs, and to monitor their progress. The bitsadmin tool uses switches to identify the work to perform. You can call bitsadmin /?
or bitsadmin /help
to get a list of switches.
Most switches require a <job>
parameter, which you set to the job's display name, or GUID. A job's display name doesn't have to be unique. The /create and /list switches return a job's GUID.
By default, you can access information about your own jobs. To access information for another user's jobs, you must have administrator privileges. If the job was created in an elevated state, then you must run bitsadmin from an elevated window; otherwise, you'll have read-only access to the job.
Many of the switches correspond to methods in the BITS interfaces. For additional details that may be relevant to using a switch, see the corresponding method.
Use the following switches to create a job, set and retrieve the properties of a job, and monitor the status of a job. For examples that show how to use some of these switches to perform tasks, see bitsadmin examples.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Retrieves information about all images on a server.
wdsutil /get-allimages [/server:<servername>] /show:{boot | install | legacyris | all} [/detailed]
Parameter | Description | |||
---|---|---|---|---|
[/server:<servername>] |
Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server is used. | |||
`/show:{boot | install | legacyris | all}` | Where boot returns only boot images, install returns install images as well as information about the image groups that contain them, LegacyRis returns only remote Installation Services (RIS) images, and All returns boot image information, install image information (including information about the image groups), and RIS image information. |
[/detailed] | Indicates that all image metadata from each image should be returned. If this option is not used, the default behavior is to return only the image name, description, and file name. |
To view information about the images, type either:
wdsutil /get-allimages /show:install
wdsutil /verbose /get-allimages /server:MyWDSServer /show:all /detailed
Boot Configuration Data (BCD) files provide a store that is used to describe boot applications and boot application settings. The objects and elements in the store effectively replace Boot.ini.
BCDEdit is a command-line tool for managing BCD stores. It can be used for a variety of purposes, including creating new stores, modifying existing stores, adding boot menu parameters, and so on. BCDEdit serves essentially the same purpose as Bootcfg.exe on earlier versions of Windows, but with two major improvements:
Exposes a wider range of boot parameters than Bootcfg.exe.
Has improved scripting support.
[!NOTE] Administrative privileges are required to use BCDEdit to modify BCD.
BCDEdit is the primary tool for editing the boot configuration of Windows Vista and later versions of Windows. It is included with the Windows Vista distribution in the %WINDIR%\System32 folder.
BCDEdit is limited to the standard data types and is designed primarily to perform single common changes to BCD. For more complex operations or nonstandard data types, consider using the BCD Windows Management Instrumentation (WMI) application programming interface (API) to create more powerful and flexible custom tools.
bcdedit /command [<argument1>] [<argument2>] ...
Option | Description |
---|---|
/? | Displays a list of BCDEdit commands. Running this command without an argument displays a summary of the available commands. To display detailed help for a particular command, run bcdedit /? <command> , where <command> is the name of the command you are searching for more information about. For example, bcdedit /? createstore displays detailed help for the Createstore command. |
Option | Description |
---|---|
/createstore | Creates a new empty boot configuration data store. The created store is not a system store. |
/export | Exports the contents of the system store into a file. This file can be used later to restore the state of the system store. This command is valid only for the system store. |
/import | Restores the state of the system store by using a backup data file previously generated by using the /export option. This command deletes any existing entries in the system store before the import takes place. This command is valid only for the system store. |
/store | This option can be used with most BCDedit commands to specify the store to be used. If this option is not specified, then BCDEdit operates on the system store. Running the bcdedit /store command by itself is equivalent to running the bcdedit /enum active command. |
Parameter | Description |
---|---|
/copy | Makes a copy of a specified boot entry in the same system store. |
/create | Creates a new entry in the boot configuration data store. If a well-known identifier is specified, then the /application, /inherit, and /device parameters cannot be specified. If an identifier is not specified or not well known, an /application, /inherit, or /device option must be specified. |
/delete | Deletes an element from a specified entry. |
Parameter | Description |
---|---|
/deletevalue | Deletes a specified element from a boot entry. |
/set | Sets an entry option value. |
Parameter | Description |
---|---|
/enum | Lists entries in a store. The /enum option is the default value for BCEdit, so running the bcdedit command without parameters is equivalent to running the bcdedit /enum active command. |
/v | Verbose mode. Usually, any well-known entry identifiers are represented by their friendly shorthand form. Specifying /v as a command-line option displays all identifiers in full. Running the bcdedit /v command by itself is equivalent to running the bcdedit /enum active /v command. |
Parameter | Description |
---|---|
/bootsequence | Specifies a one-time display order to be used for the next boot. This command is similar to the /displayorder option, except that it is used only the next time the computer starts. Afterwards, the computer reverts to the original display order. |
/default | Specifies the default entry that the boot manager selects when the timeout expires. |
/displayorder | Specifies the display order that the boot manager uses when displaying boot parameters to a user. |
/timeout | Specifies the time to wait, in seconds, before the boot manager selects the default entry. |
/toolsdisplayorder | Specifies the display order for the boot manager to use when displaying the Tools menu. |
Parameter | Description |
---|---|
/bootems | Enables or disables Emergency Management Services (EMS) for the specified entry. |
/ems | Enables or disables EMS for the specified operating system boot entry. |
/emssettings | Sets the global EMS settings for the computer. /emssettings does not enable or disable EMS for any particular boot entry. |
Parameter | Description |
---|---|
/bootdebug | Enables or disables the boot debugger for a specified boot entry. Although this command works for any boot entry, it is effective only for boot applications. |
/dbgsettings | Specifies or displays the global debugger settings for the system. This command does not enable or disable the kernel debugger; use the /debug option for that purpose. To set an individual global debugger setting, use the bcdedit /set <dbgsettings> <type> <value> command. |
/debug | Enables or disables the kernel debugger for a specified boot entry. |
For examples of how to use BCDEdit, see the BCDEdit Options Reference article.
To see the notation used to indicate command-line syntax, see Command-Line Syntax Key.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Retrieves Windows Deployment Services information about a prestaged computer (that is, a physical computer that has been lined to a computer account in active directory Domain Services.
wdsutil /Get-Device {/Device:<Device name> | /ID:<MAC or UUID>} [/Domain:<Domain>] [/forest:{Yes | No}]
Parameter | Description |
---|---|
/Device:<Device name> | Specifies the name of the computer (SAMAccountName). |
/ID:<MAC or UUID> | Specifies either the MAC address or the UUID (GUID) of the computer, as shown in the following examples. Note that a valid GUID must be in one of two formats binary string or GUID string - Binary string: /ID:ACEFA3E81F20694E953EB2DAA1E8B1B6 |
[/Domain:<Domain>] | Specifies the domain to be searched for the prestaged computer. The default value for this parameter is the local domain. |
[/forest:{Yes | No}] | Specifies whether Windows Deployment Services should search the entire forest or the local domain. The default value is No, meaning that only the local domain will be searched. |
To get information by using the computer name, type:
wdsutil /Get-Device /Device:computer1
To get information by using the MAC address, type:
wdsutil /verbose /Get-Device /ID:00-B0-56-88-2F-DC /Domain:MyDomain
To get information by using the GUID string, type:
wdsutil /verbose /Get-Device /ID:E8A3EFAC-201F-4E69-953-B2DAA1E8B1B6 /forest:Yes
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
[!IMPORTANT] In storage area network (SAN) configurations, disabling automount prevents Windows from automatically mounting or assigning drive letters to any new basic volumes that are visible to the system.
automount [ { enable | disable | scrub } ] [noerr]
Parameter | Description |
---|---|
enable | Enables Windows to automatically mount new basic and dynamic volumes that are added to the system and to assign them drive letters. |
disable | Prevents Windows from automatically mounting any new basic and dynamic volumes that are added to the system. Note: Disabling automount can cause failover clusters to fail the storage portion of the Validate a Configuration Wizard. |
scrub | Removes volume mount point directories and registry settings for volumes that are no longer in the system. This prevents volumes that were previously in the system from being automatically mounted and given their former volume mount point(s) when they are added back to the system. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To see if the automount feature is enabled, type the following commands from within the diskpart command:
automount
To enable the automount feature, type:
automount enable
To disable the automount feature, type:
automount disable
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays all computers that are in the Auto-add database on a Windows Deployment Services server.
wdsutil [Options] /Get-AutoaddDevices [/Server:<Server name>] /Devicetype:{PendingDevices | RejectedDevices | ApprovedDevices}
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
/Devicetype:{PendingDevices | RejectedDevices | ApprovedDevices} | Specifies the type of computer to return. - PendingDevices returns all computers in the database that have a status of pending. |
To see all of the approved computers, type:
wdsutil /Get-AutoaddDevices /Devicetype:ApprovedDevices
To see all of the rejected computers, type:
wdsutil /verbose /Get-AutoaddDevices /Devicetype:RejectedDevices /Server:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Retrieves information about all image groups on a server and all images in those image groups.
wdsutil [options] /get-allimagegroups [/server:<servername>] [/detailed]
Parameter | Description |
---|---|
[/server:<servername>] |
Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server is used. |
[/detailed] | Returns the image metadata from each image. If this parameter isn't used, the default behavior is to return only the image name, description, and file name for each image. |
To view information about the image groups, type either:
wdsutil /get-allimagegroups
wdsutil /verbose /get-allimagegroups /server:MyWDSServer /detailed
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sets the per-user audit policy, system audit policy, or auditing options.
To perform set 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 set 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 set operations.
auditpol /set
[/user[:<username>|<{sid}>][/include][/exclude]]
[/category:<name>|<{guid}>[,:<name|<{guid}> ]]
[/success:<enable>|<disable>][/failure:<enable>|<disable>]
[/subcategory:<name>|<{guid}>[,:<name|<{guid}> ]]
[/success:<enable>|<disable>][/failure:<enable>|<disable>]
[/option:<option name> /value: <enable>|<disable>]
Parameter | Description |
---|---|
/user | The security principal for whom the per-user audit policy specified by the category or subcategory is set. Either the category or subcategory option must be specified, as a security identifier (SID) or name. |
/include | Specified with /user; indicates that the user's per-user policy will cause an audit to be generated even if it is not specified by the system audit policy. This setting is the default and is automatically applied if neither the /include nor /exclude parameters are explicitly specified. |
/exclude | Specified with /user; indicates that the user's per-user policy will cause an audit to be suppressed regardless of the system audit policy. This setting is ignored for users who are members of the local Administrators group. |
/category | One or more audit categories specified by globally unique identifier (GUID) or name. If no user is specified, the system policy is set. |
/subcategory | One or more audit subcategories specified by GUID or name. If no user is specified, the system policy is set. |
/success | Specifies success auditing. This setting is the default and is automatically applied if neither the /success nor /failure parameters are explicitly specified. This setting must be used with a parameter indicating whether to enable or disable the setting. |
/failure | Specifies failure auditing. This setting must be used with a parameter indicating whether to enable or disable the setting. |
/option | Sets the audit policy for the CrashOnAuditFail, FullprivilegeAuditing, AuditBaseObjects, or AuditBasedirectories options. |
/sd | Sets the security descriptor used to delegate access to the audit policy. The security descriptor must be specified by using the Security Descriptor Definition Language (SDDL). The security descriptor must have a discretionary access control list (DACL). |
/? | Displays help at the command prompt. |
To set the per-user audit policy for all subcategories under the detailed Tracking category for the user mikedan so that all the user's successful attempts will be audited, type:
auditpol /set /user:mikedan /category:detailed Tracking /include /success:enable
To set the per-user audit policy for categories specified by name and GUID, and subcategories specified by GUID to suppress auditing for any successful or failed attempts, type:
auditpol /set /user:mikedan /exclude /category:Object Access,System,{6997984b-797a-11d9-bed3-505054503030}
/subcategory:{0ccee9210-69ae-11d9-bed3-505054503030},:{0ccee9211-69ae-11d9-bed3-505054503030}, /success:enable /failure:enable
To set the per-user audit policy for the specified user for all the categories for the suppression of auditing of all but successful attempts, type:
auditpol /set /user:mikedan /exclude /category:* /success:enable
To set the system audit policy for all subcategories under the detailed Tracking category to include auditing for only successful attempts, type:
auditpol /set /category:detailed Tracking /success:enable
[!NOTE] The failure setting is not altered.
To set the system audit policy for the Object Access and System categories (which is implied because subcategories are listed) and subcategories specified by GUIDs for the suppression of failed attempts and the auditing of successful attempts, type:
auditpol /set /subcategory:{0ccee9210-69ae-11d9-bed3-505054503030},{0ccee9211-69ae-11d9-bed3-505054503030}, /failure:disable /success:enable
To set the auditing options to the enabled state for the CrashOnAuditFail option, type:
auditpol /set /option:CrashOnAuditFail /value:enable
Runs when the computer is started and prior to Windows Server starting to verify the logical integrity of a file system.
Autochk.exe is a version of chkdsk that runs only on NTFS disks and only before Windows Server starts. autochk cannot be run directly from the command-line. Instead, autochk runs in the following situations:
If you try to run chkdsk on the boot volume.
If chkdsk cannot gain exclusive use of the volume.
If the volume is flagged as dirty.
[!WARNING] The autochk command-line tool cannot be directly run from the command-line. Instead, use the chkntfs command-line tool to configure the way you want autochk to run at startup.
You can use chkntfs with the /x parameter to prevent autochk from running on a specific volume or multiple volumes.
Use the chkntfs.exe command-line tool with the /t parameter to change the autochk delay from 0 seconds to up to 3 days (259,200 seconds). However, a long delay means that the computer does not start until the time elapses or until you press a key to cancel autochk.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Enables all services for Windows Deployment Services.
wdsutil [options] /Enable-Server [/Server:<Servername>]
Parameter | Description |
---|---|
[/Server:<Servername> ] |
Specifies the name of the server. This can be the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server is used. |
To enable the services on the server, type either:
wdsutil /Enable-Server
wdsutil /verbose /Enable-Server /Server:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Restores system audit policy settings, per-user audit policy settings for all users, and all auditing options from a file that is syntactically consistent with the comma-separated value (CSV) file format used by the /backup option.
To perform restore 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 restore operations if you have the Manage auditing and security log (SeSecurityPrivilege) user right, which is useful when restoring the security descriptor in the event of an error or malicious attack.
auditpol /restore /file:<filename>
Parameter | Description |
---|---|
/file | Specifies the file from which the audit policy should be restored. The file must have been created by using the /backup option or must be syntactically consistent with the CSV file format used by the /backup option. |
/? | Displays help at the command prompt. |
To restore system audit policy settings, per-user audit policy settings for all users, and all auditing options from a file named auditpolicy.csv that was created by using the /backup command, type:
auditpol /restore /file:c:\auditpolicy.csv
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Lists audit policy categories and subcategories, or lists users for whom a per-user audit policy is defined.
To perform list operations on the per-user policy, you must have Read permission for that object set in the security descriptor. You can also perform list 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 list operations.
auditpol /list
[/user|/category|subcategory[:<categoryname>|<{guid}>|*]]
[/v] [/r]
Parameter | Description |
---|---|
/user | Retrieves all users for whom the per-user audit policy has been defined. If used with the /v parameter, the security identifier (SID) of the user is also displayed. |
/category | Displays the names of categories understood by the system. If used with the /v parameter, the category globally unique identifier (GUID) is also displayed. |
/subcategory | Displays the names of subcategories and their associated GUID. |
/v | Displays the GUID with the category or subcategory, or when used with /user, displays the SID of each user. |
/r | Displays the output as a report in comma-separated value (CSV) format. |
/? | Displays help at the command prompt. |
To list all users who have a defined audit policy, type:
auditpol /list /user
To list all users who have a defined audit policy and their associated SID, type:
auditpol /list /user /v
To list all categories and subcategories in report format, type:
auditpol /list /subcategory:* /r
To list the subcategories of the detailed Tracking and DS Access categories, type:
auditpol /list /subcategory:detailed Tracking,DS Access
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Enables all services for Windows Deployment Services.
Parameter | Description |
---|---|
wdsutil enable-server command | Enables all services on a specified Windows Deployment Services server (Deployment Server). |
wdsutil enable-transportserver command | Enables all services on a specified Transport Server. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Copies images that are within the same image group. To copy images between image groups, use the wdsutil Export-Image command command and then the wdsutil add-Image command command.
wdsutil [Options] /copy-Image image:<Image name> [/Server:<Server name>] imagetype:Install imageGroup:<Image group name>] [/Filename:<File name>] /DestinationImage /Name:<Name> /Filename:<File name> [/Description:<Description>]
Parameter | Description |
---|---|
image:<Imagename> |
Specifies the name of the image to be copied. |
[/Server:<Servername> ] |
Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server is used. |
imagetype:Install | Specifies the type of image to be copied. This option must be set to install. |
\imageGroup:<Image groupname> ] |
Specifies the image group that contains the image to be copied. If no image group is specified and only one group exists on the server, that image group is used by default. If more than one image group exists on the server, you must specify the image group. |
[/Filename:<Filename> ] |
Specifies the file name of the image to be copied. If the source image cannot be uniquely identified by name, you must specify the file name. |
/DestinationImage | Specifies the settings for the destination image. The valid values are:
|
To create a copy of the specified image and name it WindowsVista.wim, type:
wdsutil /copy-Image image:Windows Vista with Office imagetype:Install /DestinationImage /Name:copy of Windows Vista with Office / Filename:WindowsVista.wim
To create a copy of the specified image, apply the specified settings, and name the copy WindowsVista.wim, type:
wdsutil /verbose /Progress /copy-Image image:Windows Vista with Office /Server:MyWDSServe imagetype:Install imageGroup:ImageGroup1
/Filename:install.wim /DestinationImage /Name:copy of Windows Vista with Office /Filename:WindowsVista.wim /Description:This is a copy of the original Windows image with Office installed
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Parameter | Description |
---|---|
wdsutil add-device command | Pre-stages a computer in active directory. |
wdsutil add-image command | Adds boot or installation images. |
wdsutil add-imagegroup command | Adds an image group. |
wdsutil add-drivergrouppackage command | Adds a driver package to a driver group. |
wdsutil add-drivergrouppackages command | Adds driver packages to a driver group. |
wdsutil add-driverpackage command | Adds a driver package to the server. |
wdsutil add-imagedriverpackage command | Adds a driver package that is in the driver store to an existing boot image on the server. |
wdsutil add-imagedriverpackages command | Adds driver packages from the driver store to a boot image on the server. |
wdsutil add-alldriverpackages subcommand | Adds driver packages from a folder to a server. |
wdsutil add-drivergroup command | Adds a driver group to a server. |
wdsutil add-drivergroupfilter command | Adds a filter to a driver group on a server. |
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.
[!NOTE] This command not supported in Windows 10.
append [[<drive>:]<path>[;...]] [/x[:on|:off]] [/path:[:on|:off] [/e]
append ;
Parameter | Description |
---|---|
[\<drive>:]<path> |
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. |
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
Adds a driver package to the server.
wdsutil /Add-DriverPackage /InfFile:<Inf File path> [/Server:<Server name>] [/Architecture:{x86 | ia64 | x64}] [/DriverGroup:<Group Name>] [/Name:<Friendly Name>]
Parameter | Description | ||
---|---|---|---|
/InfFile:<InfFilepath> |
Specifies the full path of the .inf file to add. | ||
[/Server:<Servername> ] |
Specifies the name of the server. This can be the NetBIOS name or the FQDN. If no server name is specified, the local server is used. | ||
[/Architecture:`{x86 | ia64 | x64}`] | Specifies the architecture type for the driver package. |
[/DriverGroup:<groupname> ] |
Specifies the name of the driver group to which the packages should be added. | ||
[/Name:<friendlyname> ] |
Specifies the friendly name for the driver package. |
To add a driver package, type either:
wdsutil /verbose /Add-DriverPackage /InfFile:C:\Temp\Display.inf
wdsutil /Add-DriverPackage /Server:MyWDSServer /InfFile:C:\Temp\Display.inf /Architecture:x86 /DriverGroup:x86Drivers /Name:Display Driver
Adds all driver packages that are stored in a folder to a server.
wdsutil /Add-AllDriverPackages /FolderPath:<folderpath> [/Server:<servername>] [/Architecture:{x86 | ia64 | x64}] [/DriverGroup:<groupname>]
Parameter | Description | ||
---|---|---|---|
/FolderPath:<folderpath> |
Specifies the full path to the folder that contains the .inf files for the driver packages. | ||
[/Server:<servername> ] |
Specifies the name of the server. This can be the NetBIOS name or the FQDN. If no server name is specified, the local server is used. | ||
[/Architecture:`{x86 | ia64 | x64}`] | Specifies the architecture type for the driver package. |
[/DriverGroup:<groupname> ] |
Specifies the name of the driver group to which the packages should be added. |
To add driver packages, type either:
wdsutil /verbose /Add-AllDriverPackages /FolderPath:C:\Temp\Drivers /Architecture:x86
wdsutil /Add-AllDriverPackages /FolderPath:C:\Temp\Drivers\Printers /DriverGroup:Printer Drivers
Reports the status of the backup or recovery operation that is currently running.
To get the status of the currently running backup or recovery operation using this command, you must be a member of the Backup Operators group or the Administrators group, or you must have been delegated the appropriate permissions. In addition, you must run wbadmin from an elevated command prompt, by right-clicking Command Prompt, and then selecting Run as administrator.
[!IMPORTANT] This command doesn't stop until the backup or recovery operation is finished. The command continues to run even if you close the command window. To stop the current backup or recovery operation, run the wbadmin stop job command.
wbadmin get status
Applies to: Windows Server 2022, Windows Server 2019, Windows 10, Windows 8.1, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, Windows Server 2008
Resizes the maximum amount of storage space that can be used for shadow copy storage.
The minimum amount of storage space that can be used for shadow copy storage can be specified by using the MinDiffAreaFileSize registry value. For more information, see MinDiffAreaFileSize.
[!WARNING] Resizing the storage association may cause shadow copies to disappear.
vssadmin resize shadowstorage /for=<ForVolumeSpec> /on=<OnVolumeSpec> [/maxsize=<MaxSizeSpec>]
Parameter | Description |
---|---|
/for=<ForVolumeSpec> |
Specifies the volume for which the maximum amount of storage space is to be resized. |
/on=<OnVolumeSpec> |
Specifies the storage volume. |
[/maxsize=<MaxSizeSpec> ] |
Specifies the maximum amount of space that can be used for storing shadow copies. If no value is specified for /maxsize, there's no limit placed on the amount of storage space that can be used. The MaxSizeSpec value must be 1 MB or greater and must be expressed in one of the following units: KB, MB, GB, TB, PB, or EB. If no unit is specified, MaxSizeSpec uses bytes by default. |
To resize shadow copy of volume C on volume D, with a maximum size of 900MB, type:
vssadmin resize shadowstorage /For=C: /On=D: /MaxSize=900MB
To resize shadow copy of volume C on volume D, with no maximum size, type:
vssadmin resize shadowstorage /For=C: /On=D: /MaxSize=UNBOUNDED
To resize shadow copy of volume C by 20%, type:
vssadmin resize shadowstorage /For=C: /On=C: /MaxSize=20%
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Backs up MSMQ message files and registry settings to a storage device and restores previously-stored messages and settings.
Both the backup and the restore operations stop the local MSMQ service. If the MSMQ service was started beforehand, the utility will attempt to restart the MSMQ service at the end of the backup or the restore operation. If the service was already stopped before running the utility, no attempt to restart the service is made.
Before using the MSMQ Message Backup/Restore utility you must close all local applications that are using MSMQ.
mqbkup {/b | /r} <folder path_to_storage_device>
Parameter | Description |
---|---|
/b | Specifies backup operation. |
/r | Specifies restore operation. |
<folder path_to_storage_device> |
Specifies the path where the MSMQ message files and registry settings are stored. |
/? | Displays help at the command prompt. |
If a specified folder doesn't exist while performing either the backup or restore operation, the folder is automatically created by the utility.
If you choose to specify an existing folder, it must be empty. If you specify a non-empty folder, the utility deletes every file and subfolder contained within it. In this case, you'll be prompted to give permission to delete existing files and subfolders. You can use the /y parameter to indicate that you agree beforehand to the deletion of all existing files and subfolders in the specified folder.
The locations of folders used to store MSMQ message files are stored in the registry. Therefore, the utility restores MSMQ message files to the folders specified in the registry and not to the storage folders used before the restore operation.
To backup all MSMQ message files and registry settings, and to store them in the msmqbkup folder on your C: drive, type:
mqbkup /b c:\msmqbkup
To delete all existing files and subfolders in the oldbkup folder on your C: drive, and then to store MSMQ message files and registry settings in the folder, type:
mqbkup /b /y c:\oldbkup
To restore MSMQ messages and registry settings, type:
mqbkup /r c:\msmqbkup
Displays or sets the GUID partition table (GPT) identifier or master boot record (MBR) signature for the basic or dynamic disk with focus. A basic or dynamic disk must be selected for this operation to succeed. Use the select disk command to select a disk and shift the focus to it.
uniqueid disk [id={<dword> | <GUID>}] [noerr]
Parameter | Description | |
---|---|---|
id=`{ |
|
For MBR disks, this parameter specifies a 4-byte (DWORD) value in hexadecimal form for the signature. For GPT disks, this parameter specifies a GUID for the identifier. |
noerr | For scripting only. When an error occurs, DiskPart continues to process commands as if the error didn't occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To display the signature of the MBR disk with focus, type:
uniqueid disk
To set the signature of the MBR disk with focus to the DWORD value 5f1b2c36, type:
uniqueid disk id=5f1b2c36
To set the identifier of the GPT disk with focus to the GUID value baf784e7-6bbd-4cfb-aaac-e86c96e166ee, type:
uniqueid disk id=baf784e7-6bbd-4cfb-aaac-e86c96e166ee
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Ends a process running in a session on a Remote Desktop Session Host server.
[!NOTE] You can use this command to end only those processes that belong to you, unless you are an administrator. Administrators have full access to all tskill functions and can end processes that are running in other user sessions.
To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server.
tskill {<processID> | <processname>} [/server:<servername>] [/id:<sessionID> | /a] [/v]
Parameter | Description |
---|---|
<processID> |
Specifies the ID of the process that you want to end. |
<processname> |
Specifies the name of the process that you want to end. This parameter can include wildcard characters. |
/server:<servername> |
Specifies the terminal server that contains the process that you want to end. If /server isn't specified, the current Remote Desktop Session Host server is used. |
/id:<sessionID> |
Ends the process that is running in the specified session. |
/a | Ends the process that is running in all sessions. |
/v | Displays information about the actions being performed. |
/? | Displays help at the command prompt. |
When all processes that are running in a session end, the session also ends.
If you use the <processname>
and the /server:<servername>
parameters, you must also specify either the /id:<sessionID>
or the /a parameter.
To end process 6543, type:
tskill 6543
To end the process explorer running on session 5, type:
tskill explorer /id:5
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Disconnects a session from a Remote Desktop Session Host server. If you don't specify a session ID or session name, this command disconnects the current session.
[!IMPORTANT] You must have Full Control access permission or Disconnect special access permission to disconnect another user from a session.
[!NOTE] To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server.
tsdiscon [<sessionID> | <sessionname>] [/server:<servername>] [/v]
Parameter | Description |
---|---|
<sessionID> |
Specifies the ID of the session to disconnect. |
<sessionname> |
Specifies the name of the session to disconnect. |
/server:<servername> |
Specifies the terminal server that contains the session that you want to disconnect. Otherwise, the current Remote Desktop Session Host server is used. This parameter is required only if you run the tsdiscon command from a remote server. |
/v | Displays information about the actions being performed. |
/? | Displays help at the command prompt. |
Any applications running when you disconnected the session are automatically running when you reconnect to that session with no loss of data. You can use the reset session command to end the running applications of the disconnected session, but this may result in loss of data at the session.
The console session can't be disconnected.
To disconnect the current session, type:
tsdiscon
To disconnect Session 10, type:
tsdiscon 10
To disconnect the session named TERM04, type:
tsdiscon TERM04
Creates a title for the Command Prompt window.
title [<string>]
Parameter | Description |
---|---|
<string> |
Specifies the text to appear as the title of the Command Prompt window. |
/? | Displays help at the command prompt. |
To create window title for batch programs, include the title command at the beginning of a batch program.
After a window title is set, you can reset it only by using the title command.
To change the Command Prompt window title to Updating Files while the batch file executes the copy command, and then to return the title back to Command Prompt, type the following script:
@echo off
title Updating Files
copy \\server\share\*.xls c:\users\common\*.xls
echo Files Updated.
title Command Prompt
Locks a BitLocker-protected drive to prevent access to it unless the unlock key is provided.
manage-bde -lock [<drive>] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<drive> |
Represents a drive letter followed by a colon. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To lock data drive D, type:
manage-bde –lock D:
Decrypts the drive and turns off BitLocker. All key protectors are removed when decryption is complete.
manage-bde -off [<volume>] [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
<volume> |
Specifies a drive letter followed by a colon, a volume GUID path, or a mounted volume. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To turn off BitLocker on drive C, type:
manage-bde –off C:
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Connects to a telnet server.
o[pen] <hostname> [<port>]
Parameter | Description |
---|---|
<hostname> |
Specifies the computer name or IP address. |
[<port>] |
Specifies the TCP port that the telnet server is listening on. The default is TCP port 23. |
To connect to a telnet server at telnet.microsoft.com, type:
o telnet.microsoft.com
Manages the automatic unlocking of BitLocker-protected data drives.
manage-bde -autounlock [{-enable|-disable|-clearallkeys}] <drive> [-computername <name>] [{-?|/?}] [{-help|-h}]
Parameter | Description |
---|---|
-enable | Enables automatic unlocking for a data drive. |
-disable | Disables automatic unlocking for a data drive. |
-clearallkeys | Removes all stored external keys on the operating system drive. |
<drive> |
Represents a drive letter followed by a colon. |
-computername | Specifies that manage-bde.exe will be used to modify BitLocker protection on a different computer. You can also use -cn as an abbreviated version of this command. |
<name> |
Represents the name of the computer on which to modify BitLocker protection. Accepted values include the computer's NetBIOS name and the computer's IP address. |
-? or /? | Displays brief Help at the command prompt. |
-help or -h | Displays complete Help at the command prompt. |
To enable automatic unlocking of data drive E, type:
manage-bde –autounlock -enable E:
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Updates the properties of an existing API tracing data collector.
logman update api <[-n] <name>> [options]
Parameter | Description | |
---|---|---|
-s <computer name> |
Performs the command on the specified remote computer. | |
-config <value> |
Specifies the settings file containing command options. | |
[-n] <name> |
Name of the target object. | |
-f `<bin | bincirc>` | Specifies the log format for the data collector. |
-[-]u <user [password]> |
Specifies the user to Run As. Entering a * for the password produces a prompt for the password. The password is not displayed when you type it at the password prompt. |
|
-m <[start] [stop] [[start] [stop] [...]]> |
Changed to manual start or stop instead of a scheduled begin or end time. | |
-rf <[[hh:]mm:]ss> |
Run the data collector for the specified period of time. | |
-b `<M/d/yyyy h:mm:ss[AM | PM]>` | Begin collecting data at the specified time. |
-e `<M/d/yyyy h:mm:ss[AM | PM]>` | End data collection at the specified time. |
-si <[[hh:]mm:]ss> |
Specifies the sample interval for performance counter data collectors. | |
-o `<path | dsn!log>` | Specifies the output log file or the DSN and log set name in a SQL database. |
-[-]r | Repeat the data collector daily at the specified begin and end times. | |
-[-]a | Append an existing log file. | |
-[-]ow | Overwrite an existing log file. | |
-[-]v `<nnnnnn | mmddhhmm>` | Attaches file versioning information to the end of the log file name. |
-[-]rc <task> |
Run the command specified each time the log is closed. | |
-[-]max <value> |
Maximum log file size in MB or maximum number of records for SQL logs. | |
-[-]cnf <[[hh:]mm:]ss> |
When time is specified, creates a new file when the specified time has elapsed. When time is not specified, creates a new file when the maximum size is exceeded. | |
-y | Answer yes to all questions without prompting. | |
-mods <path [path [...]]> |
Specifies the list of modules to log API calls from. | |
-inapis<module!api [module!api [...]]> |
Specifies the list of API calls to include in logging. | |
-exapis <module!api [module!api [...]]> |
Specifies the list of API calls to exclude from logging. | |
-[-]ano | Log (-ano) API names only, or do not log only (-ano) API names. | |
-[-]recursive | Log (-recursive) or do not log (-recursive) APIs recursively beyond the first layer. | |
-exe <value> |
Specifies the full path to an executable for API Tracing. | |
/? | Displays context-sensitive help. |
To update an existing API trace counter called trace_notepad, for the executable file c:\windows\notepad.exe, by excluding the API call TlsGetValue produced by the module kernel32.dll, type:
logman update api trace_notepad -exe c:\windows\notepad.exe -exapis kernel32.dll!TlsGetValue
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Updates the properties of an existing alert data collector.
logman update alert <[-n] <name>> [options]
Parameter | Description | |
---|---|---|
-s <computer name> |
Perform the command on the specified remote computer. | |
-config <value> |
Specifies the settings file containing command options. | |
[-n] <name> |
Name of the target object. | |
-[-]u <user [password]> |
Specifies the user to Run As. Entering an * for the password produces a prompt for the password. The password is not displayed when you type it at the password prompt. |
|
-m <[start] [stop] [[start] [stop] [...]]> |
Changes to manual start or stop instead of a scheduled begin or end time. | |
-rf <[[hh:]mm:]ss> |
Runs the data collector for the specified period of time. | |
-b `<M/d/yyyy h:mm:ss[AM | PM]>` | Begins collecting data at the specified time. |
-e `<M/d/yyyy h:mm:ss[AM | PM]>` | Ends data collection at the specified time. |
-si <[[hh:]mm:]ss> |
Specifies the sample interval for performance counter data collectors. | |
-o `<path | dsn!log>` | Specifies the output log file or the DSN and log set name in a SQL database. |
-[-]r | Repeats the data collector daily at the specified begin and end times. | |
-[-]a | Appends an existing log file. | |
-[-]ow | Overwrites an existing log file. | |
-[-]v `<nnnnnn | mmddhhmm>` | Attaches file versioning information to the end of the log file name. |
-[-]rc <task> |
Runs the command specified each time the log is closed. | |
-[-]max <value> |
Maximum log file size in MB or maximum number of records for SQL logs. | |
-[-]cnf <[[hh:]mm:]ss> |
When time is specified, creates a new file when the specified time has elapsed. When time is not specified, creates a new file when the maximum size is exceeded. | |
-y | Answers yes to all questions without prompting. | |
-cf <filename> |
Specifies the file listing performance counters to collect. The file should contain one performance counter name per line. | |
-[-]el | Enables or disables Event Log reporting. | |
-th <threshold [threshold [...]]> |
Specify counters and their threshold values for an alert. | |
-[-]rdcs <name> |
Specifies the Data Collector Set to start when an alert fires. | |
-[-]tn <task> |
Specifies the task to run when an alert fires. | |
-[-]targ <argument> |
Specifies the task arguments to be used with the task specified using -tn. | |
/? | Displays context-sensitive help. |
To update the existing alert called new_alert, setting the threshold value for the counter % Processor time in the Processor(_Total) counter group to 40%, type:
logman update alert new_alert -th \Processor(_Total)\% Processor time>40
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Queries data collector or data collector set properties.
logman query [providers|Data Collector Set name] [options]
Parameter | Description |
---|---|
-s <computer name> |
Perform the command on the specified remote computer. |
-config <value> |
Specifies the settings file containing command options. |
[-n] <name> |
Name of the target object. |
-ets | Sends commands to Event Trace Sessions directly without saving or scheduling. |
/? | Displays context-sensitive help. |
To list all Data Collector Sets configured on the target system, type:
logman query
To list the data collectors contained in the Data Collector Set named perf_log, type:
logman query perf_log
To list all available providers of data collectors on the target system, type:
logman query providers
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
The logman start command starts a data collector and sets the begin time to manual. The logman stop command stops a Data Collector Set and sets the end time to manual.
logman start <[-n] <name>> [options]
logman stop <[-n] <name>> [options]
Parameter | Description |
---|---|
-s <computer name> |
Perform the command on the specified remote computer. |
-config <value> |
Specifies the settings file containing command options. |
[-n] <name> |
Specifies the name of the target object. |
-ets | Sends commands to Event Trace Sessions directly, without saving or scheduling. |
-as | Performs the requested operation asynchronously. |
-? | Displays context-sensitive help. |
To start the data collector perf_log, on the remote computer server_1, type:
logman start perf_log -s server_1
Enables an administrator to recover access to a file that previously was denied, by making the administrator the owner of the file. This command is typically used on batch files.
takeown [/s <computer> [/u [<domain>\]<username> [/p [<password>]]]] /f <filename> [/a] [/r [/d {Y|N}]]
Parameter | Description | |
---|---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (do not use backslashes). The default value is the local computer. This parameter applies to all of the files and folders specified in the command. | |
/u [<domain>\]<username> |
Runs the script with the permissions of the specified user account. The default value is system permissions. | |
/p [<[password>] |
Specifies the password of the user account that is specified in the /u parameter. | |
/f <filename> |
Specifies the file name or directory name pattern. You can use the wildcard character * when specifying the pattern. You can also use the syntax <sharename>\<filename> . |
|
/a | Gives ownership to the Administrators group instead of the current user. If you don't specify this option, file ownership is given to the user who is currently logged on to the computer. | |
/r | Performs a recursive operation on all files in the specified directory and subdirectories. | |
/d `{Y | N}` | Suppresses the confirmation prompt that is displayed when the current user does not have the List Folder permission on a specified directory, and instead uses the specified default value. Valid values for the /d option are:
|
/? | Displays help at the command prompt. |
Mixed patterns using (? and *) aren't supported by takeown command.
After deleting the lock with takeown, you might have to use Windows Explorer to give yourself full permissions to the files and directories before you can delete them.
To take ownership of a file named Lostfile, type:
takeown /f lostfile
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates an API tracing data collector.
logman create api <[-n] <name>> [options]
Parameter | Description | |
---|---|---|
-s <computer name> |
Performs the command on the specified remote computer. | |
-config <value> |
Specifies the settings file containing command options. | |
[-n] <name> |
Name of the target object. | |
-f `<bin | bincirc>` | Specifies the log format for the data collector. |
-[-]u <user [password]> |
Specifies the user to Run As. Entering a * for the password produces a prompt for the password. The password is not displayed when you type it at the password prompt. |
|
-m <[start] [stop] [[start] [stop] [...]]> |
Changed to manual start or stop instead of a scheduled begin or end time. | |
-rf <[[hh:]mm:]ss> |
Run the data collector for the specified period of time. | |
-b `<M/d/yyyy h:mm:ss[AM | PM]>` | Begin collecting data at the specified time. |
-e `<M/d/yyyy h:mm:ss[AM | PM]>` | End data collection at the specified time. |
-si <[[hh:]mm:]ss> |
Specifies the sample interval for performance counter data collectors. | |
-o `<path | dsn!log>` | Specifies the output log file or the DSN and log set name in a SQL database. |
-[-]r | Repeat the data collector daily at the specified begin and end times. | |
-[-]a | Append an existing log file. | |
-[-]ow | Overwrite an existing log file. | |
-[-]v `<nnnnnn | mmddhhmm>` | Attaches file versioning information to the end of the log file name. |
-[-]rc <task> |
Run the command specified each time the log is closed. | |
-[-]max <value> |
Maximum log file size in MB or maximum number of records for SQL logs. | |
-[-]cnf <[[hh:]mm:]ss> |
When time is specified, creates a new file when the specified time has elapsed. When time is not specified, creates a new file when the maximum size is exceeded. | |
-y | Answer yes to all questions without prompting. | |
-mods <path [path [...]]> |
Specifies the list of modules to log API calls from. | |
-inapis<module!api [module!api [...]]> |
Specifies the list of API calls to include in logging. | |
-exapis <module!api [module!api [...]]> |
Specifies the list of API calls to exclude from logging. | |
-[-]ano | Log (-ano) API names only, or do not log only (-ano) API names. | |
-[-]recursive | Log (-recursive) or do not log (-recursive) APIs recursively beyond the first layer. | |
-exe <value> |
Specifies the full path to an executable for API Tracing. | |
/? | Displays context-sensitive help. |
To create an API trace counter called trace_notepad, for the executable file c:\windows\notepad.exe, and putting the results in the file c:\notepad.etl, type:
logman create api trace_notepad -exe c:\windows\notepad.exe -o c:\notepad.etl
To create an API trace counter called trace_notepad, for the executable file c:\windows\notepad.exe, collecting values produced by the module at c:\windows\system32\advapi32.dll, type:
logman create api trace_notepad -exe c:\windows\notepad.exe -mods c:\windows\system32\advapi32.dll
To create an API trace counter called trace_notepad, for the executable file c:\windows\notepad.exe, excluding the API call TlsGetValue produced by the module kernel32.dll, type:
logman create api trace_notepad -exe c:\windows\notepad.exe -exapis kernel32.dll!TlsGetValue
Associates a path with a drive letter. If used without parameters, subst displays the names of the virtual drives in effect.
subst [<drive1>: [<drive2>:]<path>]
subst <drive1>: /d
Parameter | Description |
---|---|
<drive1>: |
Specifies the virtual drive to which you want to assign a path. |
[<drive2>:]<path> |
Specifies the physical drive and path that you want to assign to a virtual drive. |
/d | Deletes a substituted (virtual) drive. |
/? | Displays help at the command prompt. |
The following commands don't work and must not be used on drives specified in the subst command:
The <drive1>
parameter must be within the range that is specified by the lastdrive command. If not, subst displays the following error message: Invalid parameter - drive1:
To create a virtual drive z for the path b:\user\betty\forms, type:
subst z: b:\user\betty\forms
Instead of typing the full path, you can reach this directory by typing the letter of the virtual drive followed by a colon as follows:
z:
Displays a list of disks, of partitions in a disk, of volumes in a disk, or of virtual hard disks (VHDs).
list { disk | partition | volume | vdisk }
Parameter | Description |
---|---|
disk | Displays a list of disks and information about them, such as their size, amount of available free space, whether the disk is a basic or dynamic disk, and whether the disk uses the master boot record (MBR) or GUID partition table (GPT) partition style. |
partition | Displays the partitions listed in the partition table of the current disk. |
volume | Displays a list of basic and dynamic volumes on all disks. |
vdisk | Displays a list of the VHDs that are attached and/or selected. This command lists detached VHDs if they are currently selected; however, the disk type is set to Unknown until the VHD is attached. The VHD marked with an asterisk (*) has focus. |
When listing partitions on a dynamic disk, the partitions might not correspond to the dynamic volumes on the disk. This discrepancy occurs because dynamic disks contain entries in the partition table for the system volume or boot volume (if present on the disk). They also contain a partition that occupies the remainder of the disk in order to reserve the space for use by dynamic volumes.
The object marked with an asterisk (*) has focus.
When listing disks, if a disk is missing, its disk number is prefixed with M. For example, the first missing disk is numbered M0.
list disk
list partition
list volume
list vdisk
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
The Diskpart shrink command reduces the size of the selected volume by the amount you specify. This command makes free disk space available from the unused space at the end of the volume.
A volume must be selected for this operation to succeed. Use the select volume command to select a volume and shift the focus to it.
[!NOTE] This command works on basic volumes, and on simple or spanned dynamic volumes. It doesn't work on original equipment manufacturer (OEM) partitions, Extensible Firmware Interface (EFI) system partitions, or recovery partitions.
shrink [desired=<n>] [minimum=<n>] [nowait] [noerr]
shrink querymax [noerr]
Parameter | Description |
---|---|
desired=<n> |
Specifies the desired amount of space in megabytes (MB) to reduce the size of the volume by. |
minimum=<n> |
Specifies the minimum amount of space in MB to reduce the size of the volume by. |
querymax | Returns the maximum amount of space in MB by which the volume can be reduced. This value may change if applications are currently accessing the volume. |
nowait | Forces the command to return immediately while the shrink process is still in progress. |
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
You can reduce the size of a volume only if it is formatted using the NTFS file system or if it does not have a file system.
If a desired amount isn't specified, the volume is reduced by the minimum amount (if specified).
If a minimum amount isn't specified, the volume is reduced by the desired amount (if specified).
If neither a minimum amount nor a desired amount is specified, the volume is reduced by as much as possible.
If a minimum amount is specified, but not enough free space is available, the command fails.
To reduce the size of the selected volume by the largest possible amount between 250 and 500 megabytes, type:
shrink desired=500 minimum=250
To display the maximum number of MB that the volume can be reduced by, type:
shrink querymax
Starts the Kernel Transaction Manager utility. If used without parameters, ktmutil displays available subcommands.
ktmutil list tms
ktmutil list transactions [{TmGUID}]
ktmutil resolve complete {TmGUID} {RmGUID} {EnGUID}
ktmutil resolve commit {TxGUID}
ktmutil resolve rollback {TxGUID}
ktmutil force commit {GUID}
ktmutil force rollback {GUID}
ktmutil forget
To force an Indoubt transaction with GUID 311a9209-03f4-11dc-918f-00188b8f707b to commit, type:
ktmutil force commit {311a9209-03f4-11dc-918f-00188b8f707b}
Specifies whether verbose output is provided during shadow copy creation. If used without parameters, set verbose displays help at the command prompt.
set verbose {on | off}
Parameter | Description |
---|---|
on | Turns on verbose output logging during the shadow copy creation process. If verbose mode is on, set provides details of writer inclusion or exclusion and details of metadata compression and extraction. |
off | Turns off verbose output logging during the shadow copy creation process. |
Sets the encryption type attribute for the domain. A status message is displayed upon successful or failed completion.
You can view the encryption type for the Kerberos ticket-granting ticket (TGT) and the session key, by running the klist command and viewing the output. You can set the domain to connect to and use, by running the ksetup /domain <domainname>
command.
ksetup /setenctypeattr <domainname> {DES-CBC-CRC | DES-CBC-MD5 | RC4-HMAC-MD5 | AES128-CTS-HMAC-SHA1-96 | AES256-CTS-HMAC-SHA1-96}
Parameter | Description |
---|---|
<domainname> |
Name of the domain to which you want to establish a connection. Use the fully qualified domain name or a simple form of the name, such as corp.contoso.com or contoso. |
encryption type | Must be one of the following supported encryption types:
|
To view the encryption type for the Kerberos ticket-granting ticket (TGT) and the session key, type:
klist
To set the domain to corp.contoso.com, type:
ksetup /domain corp.contoso.com
To set the encryption type attribute to AES-256-CTS-HMAC-SHA1-96 for the domain corp.contoso.com, type:
ksetup /setenctypeattr corp.contoso.com AES-256-CTS-HMAC-SHA1-96
To verify that the encryption type attribute was set as intended for the domain, type:
ksetup /getenctypeattr corp.contoso.com
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the partition type field for the partition with focus. This command doesn't work on dynamic disks or on Microsoft Reserved partitions.
[!IMPORTANT] This command is intended for use by original equipment manufacturers (OEMs) only. Changing partition type fields with this parameter might cause your computer to fail or be unable to boot. Unless you are an OEM or experienced with gpt disks, you should not change partition type fields on gpt disks by using this parameter. Instead, always use the create partition efi command to create EFI system partitions, the create partition msr command to create Microsoft Reserved partitions, and the create partition primary command without the ID parameter to create primary partitions on gpt disks.
set id={ <byte> | <GUID> } [override] [noerr]
Parameter | Description |
---|---|
<byte> |
For master boot record (MBR) disks, specifies the new value for the type field, in hexadecimal form, for the partition. Any partition type byte can be specified with this parameter except for type 0x42, which specifies an LDM partition. Note that the leading 0x is omitted when specifying the hexadecimal partition type. |
<GUID> |
For GUID partition table (gpt) disks, specifies the new GUID value for the type field for the partition. Recognized GUIDs include:
|
override | forces the file system on the volume to dismount before changing the partition type. When you run the set id command, DiskPart attempts to lock and dismount the file system on the volume. If override isn't specified, and the call to lock the file system fails (for example, because there is an open handle), the operation fails. If override is specified, DiskPart forces the dismount even if the call to lock the file system fails, and any open handles to the volume will stop being valid. |
noerr | Used for scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To set the type field to 0x07 and force the file system to dismount, type:
set id=0x07 override
To set the type field to be a basic data partition, type:
set id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
Allows you to specify a name for a computer running the Windows operating system, so changes made by the ksetup command update the target computer.
The target server name is stored in the registry under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\LSA\Kerberos
. This entry isn't reported when you run the ksetup command.
[!IMPORTANT] There's no way to remove the targeted server name. Instead, you can change it back to the local computer name, which is the default.
ksetup /server <servername>
Parameter | Description |
---|---|
<servername> |
Specifies the full computer name on which the configuration will be effective, such as IPops897.corp.contoso.com. If an incomplete fully-qualified domain computer name is specified, the command will fail. |
To make your ksetup configurations effective on the IPops897 computer, which is connected on the Contoso domain, type:
ksetup /server IPops897.corp.contoso.com
Maps the name of a Kerberos principal to an account.
ksetup /mapuser <principal> <account>
Parameter | Description |
---|---|
<principal> |
Specifies the fully-qualified domain name of any principal user. For example, mike@corp.CONTOSO.COM. If you don't specify an account parameter, mapping is deleted for the specified principal. |
<account> |
Specifies any account or security group name that exists on this computer, such as Guest, Domain Users, or Administrator. If this parameter is omitted, mapping is deleted for the specified principal. |
An account can be specifically identified, such as Domain Guests, or you can use a wildcard character (*) to include all accounts.
The computer only authenticates the principals of the given realm if they present valid Kerberos tickets.
Whenever changes are made to the external Key Distribution Center (KDC) and the realm configuration, a restart of the computer where the setting was changed is required.
To see the current mapped settings and the default realm, type:
ksetup
To map Mike Danseglio's account within the Kerberos realm CONTOSO to the guest account on this computer, granting him all the privileges of a member of the built-in Guest account without having to authenticate to this computer, type:
ksetup /mapuser mike@corp.CONTOSO.COM guest
To remove the mapping of Mike Danseglio's account to the guest account on this computer to prevent him from authenticating to this computer with his credentials from CONTOSO, type:
ksetup /mapuser mike@corp.CONTOSO.COM
To map Mike Danseglio's account within the CONTOSO Kerberos realm to any existing account on this computer, type:
ksetup /mapuser mike@corp.CONTOSO.COM *
[!NOTE] If only the Standard User and Guest accounts are active on this computer, Mike's privileges are set to those.
To map all accounts within the CONTOSO Kerberos realm to any existing account of the same name on this computer, type:
ksetup /mapuser * *
Deletes all information for the specified realm from the registry.
The realm name is stored in the registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos
and HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Lsa\Kerberos
. This entry doesn't exist in the registry by default. You can use the ksetup addrealmflags command to populate the registry.
[!IMPORTANT] You can't remove the default realm name from the domain controller because this resets its DNS information, and removing it might make the domain controller unusable.
ksetup /removerealm <realmname>
Parameter | Description |
---|---|
<realmname> |
Specifies the uppercase DNS name, such as CORP.CONTOSO.COM, and is listed as the default realm or Realm= when ksetup is run. |
To remove an erroneous realm name (.CON instead of .COM) from the local computer, type:
ksetup /removerealm CORP.CONTOSO.CON
To verify the removal, you can run the ksetup command and review the output.
Sets the context, options, verbose mode, and metadata file for shadow copy creation. If used without parameters, set lists all current settings.
set
set context
set option
set verbose
set metadata
Parameters | Description |
---|---|
set context | Sets the context for shadow copy creation. |
set metadata | Sets the name and location of the shadow creation metadata file. |
set option | Sets options for shadow copy creation. |
set verbose | Turns the verbose output mode on or off. |
/? | Displays help at the command prompt. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Allows you to participate in the Customer Experience Improvement Program (CEIP).
serverceipoptin [/query] [/enable] [/disable]
Parameter | Description |
---|---|
/query | Verifies your current setting. |
/enable | Turns on your participation in CEIP. |
/disable | Turns off your participation in CEIP. |
/? | Displays help at the command prompt. |
To verify your current settings, type:
serverceipoptin /query
To turn on your participation, type:
serverceipoptin /enable
To turn off your participation, type:
serverceipoptin /disable
Sets the domain name for all Kerberos operations.
ksetup /domain <domainname>
Parameter | Description |
---|---|
<domainname> |
Name of the domain to which you want to establish a connection. Use the fully-qualified domain name or a simple form of the name, such as contoso.com or contoso. |
To establish a connection to a valid domain, such as Microsoft, by using the ksetup /mapuser
subcommand, type:
ksetup /mapuser principal@realm domain-user /domain domain-name
After a successful connection, you'll receive a new TGT or an existing TGT will be refreshed.
Displays the current state of realm settings for all realms that are defined on the computer. This command displays the same output as the ksetup command.
ksetup /dumpstate
The output of this command includes the default realm (the domain that the computer is a member of) and all the realms that are defined on this computer. The following is included for each realm:
All the Key Distribution Centers (KDCs) that are associated with this realm.
All the set realm flags for this realm.
The KDC password.
This command doesn't display the domain name specified by DNS detection or by the command ksetup /domain
.
This command doesn't display the computer password set by using the command ksetup /setcomputerpassword
.
To locate the Kerberos realm configurations on a computer, type:
ksetup /dumpstate
Deletes instances of Key Distribution Center (KDC) names for the Kerberos realm.
The mapping is stored in the registry, under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\LSA\Kerberos\Domains
. After running this command, we recommend making sure the KDC was removed and no longer appears in the list.
[!NOTE] To remove realm configuration data from multiple computers, use the Security Configuration Template snap-in with policy distribution, instead of using the ksetup command explicitly on individual computers.
ksetup /delkdc <realmname> <KDCname>
Parameter | Description |
---|---|
<realmname> |
Specifies the uppercase DNS name, such as CORP.CONTOSO.COM. This is the default realm that appears when you run the ksetup command, and it's the realm from which you want to delete the KDC. |
<KDCname> |
Specifies the case-sensitive, fully-qualified domain name, such as mitkdc.contoso.com. |
To view all of the associations between the Windows realm and the non-Windows realm, and to determine which ones to remove, type:
ksetup
To remove the association, type:
ksetup /delkdc CORP.CONTOSO.COM mitkdc.contoso.com
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Selects the specified partition and shifts the focus to it. This command can also be used to display the partition that currently has the focus in the selected disk.
select partition=<n>
Parameter | Description |
---|---|
partition=<n> |
The number of the partition to receive the focus. You can view the numbers for all partitions on the disk currently selected by using the list partition command in DiskPart. |
Before you can select a partition you must first select a disk using the select disk command.
If no partition number is specified, this option displays the partition that currently has the focus in the selected disk.
If a volume is selected with a corresponding partition, the partition is automatically selected.
If a partition is selected with a corresponding volume, the volume is automatically selected.
To shift the focus to partition 3, type:
select partitition=3
To display the partition that currently has the focus in the selected disk, type:
select partition
Validates the security settings stored in a security template (.inf file). Validating security templates can help you determine if one is corrupted or inappropriately set. Corrupted or inappropriately set security templates aren't applied.
secedit /validate <configuration file name>
Parameter | Description |
---|---|
<configuration file name> |
Required. Specifies the path and file name for the security template that will be validated. Log files aren't updated by this command. |
To verify that the rollback .inf file, secRBKcontoso.inf, is still valid after rollback, type:
secedit /validate secRBKcontoso.inf
Shifts the focus to a disk, partition, volume, or virtual hard disk (VHD).
select disk
select partition
select vdisk
select volume
Parameter | Description |
---|---|
Select disk | Shifts the focus to a disk. |
Select partition | Shifts the focus to a partition. |
Select vdisk | Shifts the focus to a VHD. |
Select volume | Shifts the focus to a volume. |
If a volume is selected with a corresponding partition, the partition will be automatically selected.
If a partition is selected with a corresponding volume, the volume will be automatically selected.
Adds a Kerberos password (kpasswd) server address for a realm.
ksetup /addkpasswd <realmname> [<kpasswdname>]
Parameter | Description |
---|---|
<realmname> |
Specifies the uppercase DNS name, such as CORP.CONTOSO.COM, and is listed as the default realm or Realm= when ksetup is run. |
<kpasswdname> |
Specifies the Kerberos password server. It's stated as a case-insensitive, fully-qualified domain name, such as mitkdc.contoso.com. If the KDC name is omitted, DNS might be used to locate KDCs. |
If the Kerberos realm that the workstation will be authenticating to supports the Kerberos change password protocol, you can configure a client computer running the Windows operating system to use a Kerberos password server.
You can add additional KDC names one at a time.
To configure the CORP.CONTOSO.COM realm to use the non-Windows KDC server, mitkdc.contoso.com, as the password server, type:
ksetup /addkpasswd CORP.CONTOSO.COM mitkdc.contoso.com
To verify the KDC name is set, type ksetup
and then view the output, looking for the text, kpasswd =. If you don't see the text, it means the mapping hasn't been configured.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2012 R2 and Windows Server 2012
Renders an .xml file by using a specified .xsl transform. This command can be useful for displaying Security Configuration Wizard (SCW) .xml files by using different views.
scwcmd view /x:<Xmlfile.xml> [/s:<Xslfile.xsl>]
Parameter | Description |
---|---|
/x:<Xmlfile.xml> |
Specifies the .xml file to be viewed. This parameter must be specified. |
/s:<Xslfile.xsl> |
Specifies the .xsl transform to apply to the .xml file as part of the rendering process. This parameter is optional for SCW .xml files. When the view command is used to render a SCW .xml file, it will automatically try to load the correct default transform for the specified .xml file. If an .xsl transform is specified, the transform must be written under the assumption that the .xml file is in the same directory as the .xsl transform. |
/? | Displays help at the command prompt. |
To view Policyfile.xml by using the Policyview.xsl transform, type:
scwcmd view /x:C:\policies\Policyfile.xml /s:C:\viewers\Policyview.xsl
Adds a service principal name (SPN) mapping between the stated host and the realm. This command also allows you to map a host or multiple hosts that are sharing the same DNS suffix to the realm.
The mapping is stored in the registry, under HKEY_LOCAL_MACHINE\SYSTEM\CurrentContolSet\Control\Lsa\Kerberos\HostToRealm.
ksetup /addhosttorealmmap <hostname> <realmname>
Parameter | Description |
---|---|
<hostname> |
The host name is the computer name, and it can be stated as the computer's fully qualified domain name. |
<realmname> |
The realm name is stated as an uppercase DNS name, such as CORP.CONTOSO.COM. |
To map the host computer IPops897 to the CONTOSO realm, type:
ksetup /addhosttorealmmap IPops897 CONTOSO
Check the registry to make sure the mapping occurred as intended.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2012 R2 and Windows Server 2012
Applies the most recent rollback policy available, and then deletes that rollback policy.
scwcmd rollback /m:<computername> [/u:<username>] [/pw:<password>]
Parameter | Description |
---|---|
/m:<computername> |
Specifies the NetBIOS name, DNS name, or IP address of a computer where the rollback operation should be performed. |
/u:<username> |
Specifies an alternate user account to use when performing a remote rollback. The default is the logged on user. |
/pw:<password> |
Specifies an alternate user credential to use when performing a remote rollback. The default is the logged on user. |
/? | Displays help at the command prompt. |
To roll back the security policy on a computer at IP address 172.16.0.0, type:
scwcmd rollback /m:172.16.0.0
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Compacts a Windows Internet Name Service (WINS) or Dynamic Host Configuration Protocol (DHCP) database. We recommend you compact the WINS database whenever it approaches 30 MB.
Jetpack.exe compacts the database by:
Copying the database information to a temporary database file.
Deleting the original database file, either WINS or DHCP.
Renames the temporary database files to the original filename.
jetpack.exe <database_name> <temp_database_name>
Parameter | Description |
---|---|
<database_name> |
Specifies the name of the original database file. |
<temp_database_name> |
Specifies the name of the temporary database file to be created by jetpack.exe. Note: This temporary file is removed when the compact process is complete. For this command to work properly, you must make sure your temp file name is unique and that a file with that name doesn't already exist. |
/? | Displays help at the command prompt. |
To compact the WINS database, where Tmp.mdb is a temporary database and Wins.mdb is the WINS database, type:
cd %SYSTEMROOT%\SYSTEM32\WINS
NET STOP WINS
jetpack Wins.mdb Tmp.mdb
NET start WINS
To compact the DHCP database, where Tmp.mdb is a temporary database and Dhcp.mdb is the DHCP database, type:
cd %SYSTEMROOT%\SYSTEM32\DHCP
NET STOP DHCPSERVER
jetpack Dhcp.mdb Tmp.mdb
NET start DHCPSERVER
Starts a scheduled task immediately. The run operation ignores the schedule, but uses the program file location, user account, and password saved in the task to run the task immediately. Running a task does not affect the task schedule and does not change the next run time scheduled for the task.
schtasks /run /tn <taskname> [/s <computer> [/u [<domain>\]<user> [/p <password>]]]
Parameter | Description |
---|---|
/tn <taskname> |
Identifies the task to start. This parameter is required. |
/s <computer> |
Specifies the name or IP address of a remote computer (with or without backslashes). The default is the local computer. |
/u [<domain>] |
Runs this command with the permissions of the specified user account. By default, the command runs with the permissions of the current user of the local computer. The specified user account must be a member of the Administrators group on the remote computer. The /u and /p parameters are valid only when you use /s. |
/p <password> |
Specifies the password of the user account specified in the /u parameter. If you use the /u parameter without the /p parameter or the password argument, schtasks will prompt you for a password. The /u and /p parameters are valid only when you use /s. |
/? | Displays help at the command prompt. |
Use this operation to test your tasks. If a task doesn't run, check the Task Scheduler Service transaction log, <Systemroot>\SchedLgU.txt
for errors.
To run a task remotely, the task must be scheduled on the remote computer. When you run the task, it runs only on the remote computer. To verify that a task is running on a remote computer, use Task Manager or the Task Scheduler Service transaction log, <Systemroot>\SchedLgU.txt
.
To start the Security Script task, type:
schtasks /run /tn Security Script
To start the Update task on a remote computer, Svr01, type:
schtasks /run /tn Update /s Svr01
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays and modifies information about the routing tables used by the IPX protocol. Used without parameters, ipxroute displays the default settings for packets that are sent to unknown, broadcast, and multicast addresses.
ipxroute servers [/type=x]
ipxroute ripout <network>
ipxroute resolve {guid | name} {GUID | <adaptername>}
ipxroute board= N [def] [gbr] [mbr] [remove=xxxxxxxxxxxx]
ipxroute config
Parameter | Description | ||
---|---|---|---|
servers[/type=x] |
Displays the Service Access Point (SAP) table for the specified server type. x must be an integer. For example, /type=4 displays all file servers. If you don't specify /type, ipxroute servers displays all types of servers, listing them by server name. |
||
resolve`{GUID | name} {GUID |
adaptername}` | Resolves the name of the GUID to its friendly name, or the friendly name to its GUID. |
board= n | Specifies the network adapter for which to query or set parameters. | ||
def | Sends packets to the ALL ROUTES broadcast. If a packet is transmitted to a unique Media Access Card (MAC) address that is not in the source routing table, ipxroute sends the packet to the SINGLE ROUTES broadcast by default. | ||
gbr | Sends packets to the ALL ROUTES broadcast. If a packet is transmitted to the broadcast address (FFFFFFFFFFFF), ipxroute sends the packet to the SINGLE ROUTES broadcast by default. | ||
mbr | Sends packets to the ALL ROUTES broadcast. If a packet is transmitted to a multicast address (C000xxxxxxxx), ipxroute sends the packet to the SINGLE ROUTES broadcast by default. | ||
remove=xxxxxxxxxxxx | removes the given node address from the source routing table. | ||
config | Displays information about all of the bindings for which IPX is configured. | ||
/? | Displays help at the command prompt. |
To display the network segments that the workstation is attached to, the workstation node address, and frame type being used, type:
ipxroute config
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays the host name portion of the full computer name of the computer.
[!IMPORTANT] This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network.
hostname
Parameter | Description |
---|---|
/? | Displays help at the command prompt. |
Any parameter different than /?
produces an error message and sets the errorlevel to 1.
%COMPUTERNAME%
usually will print the same string as hostname
, but in uppercase._CLUSTER_NETWORK_NAME_
is defined, hostname
will print its value.hostname
echo %COMPUTERNAME%
set "_CLUSTER_NETWORK_NAME_=Altered Computer Name"
hostname
Runs commands on remote computers running the RSH service or daemon.
[!IMPORTANT] The rexec command has been deprecated, and isn't guaranteed to be supported in Windows.
After installing the subsystem for UNIX-based Applications, you can then open a C Shell or Korn Shell command window and run rsh. For more information, type man rsh at the C Shell or Korn Shell prompt.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays a list of the available commands or detailed help information on a specified command. If used without parameters, help lists and briefly describes every system command.
help [<command>]
Parameter | Description |
---|---|
<command> |
Specifies the command for which to display detailed help information. |
To view information about the robocopy command, type:
help robocopy
To display a list of all commands available in DiskPart, type:
help
To display detailed help information about how to use the create partition primary command in DiskPart, type:
help create partition primary
The helpctr command has been deprecated, and isn't guaranteed to be supported in Windows.
This tool is included in Windows Server 2003. For more information, see Helpctr.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Lists programs on remote computers. The rpcinfo command-line utility makes a remote procedure call (RPC) to an RPC server and reports what it finds.
rpcinfo [/p [<node>]] [/b <program version>] [/t <node program> [<version>]] [/u <node program> [<version>]]
Parameter | Description |
---|---|
/p [<node>] |
lists all programs registered with the port mapper on the specified host. If you do not specify a node (computer) name, the program queries the port mapper on the local host. |
/b <program version> |
Requests a response from all network nodes that have the specified program and version registered with the port mapper. You must specify both a program name or number and a version number. |
/t <node program> [\<version>] |
Uses the TCP transport protocol to call the specified program. You must specify both a node (computer) name and a program name. If you do not specify a version, the program calls all versions. |
/u <node program> [\<version>] |
Uses the UDP transport protocol to call the specified program. You must specify both a node (computer) name and a program name. If you do not specify a version, the program calls all versions. |
/? | Displays help at the command prompt. |
To list all programs registered with the port mapper, type:
rpcinfo /p [<node>]
To request a response from network nodes that have a specified program, type:
rpcinfo /b <program version>
To use Transmission Control Protocol (TCP) to call a program, type:
rpcinfo /t <node program> [<version>]
Use User Datagram Protocol (UDP) to call a program:
rpcinfo /u <node program> [<version>]
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays the Resultant Set of Policy (RSoP) information for a remote user and computer. To use RSoP reporting for remotely targeted computers through the firewall, you must have firewall rules that enable inbound network traffic on the ports.
gpresult [/s <system> [/u <username> [/p [<password>]]]] [/user [<targetdomain>\]<targetuser>] [/scope {user | computer}] {/r | /v | /z | [/x | /h] <filename> [/f] | /?}
[!NOTE] Except when using /?, you must include an output option, /r, /v, /z, /x, or /h.
Parameter | Description | |
---|---|---|
/s <system> |
Specifies the name or IP address of a remote computer. Don't use backslashes. The default is the local computer. | |
/u <username> |
Uses the credentials of the specified user to run the command. The default user is the user who is logged on to the computer that issues the command. | |
/p [<password>] |
Specifies the password of the user account that is provided in the /u parameter. If /p is omitted, gpresult prompts for the password. The /p parameter can't be used with /x or /h. | |
/user [<targetdomain>\]<targetuser>] |
Specifies the remote user whose RSoP data is to be displayed. | |
/scope `{user | computer}` | Displays RSoP data for either the user or the computer. If /scope is omitted, gpresult displays RSoP data for both the user and the computer. |
`[/x | /h] |
Saves the report in either XML (/x) or HTML (/h) format at the location and with the file name that is specified by the filename parameter. Can't be used with /u, /p, /r, /v, or /z. |
/f | Forces gpresult to overwrite the file name that is specified in the /x or /h option. | |
/r | Displays RSoP summary data. | |
/v | Displays verbose policy information. This includes detailed settings that were applied with a precedence of 1. | |
/z | Displays all available information about Group Policy. This includes detailed settings that were applied with a precedence of 1 and higher. | |
/? | Displays help at the command prompt. |
Group Policy is the primary administrative tool for defining and controlling how programs, network resources, and the operating system operate for users and computers in an organization. In an active directory environment, Group Policy is applied to users or computers based on their membership in sites, domains, or organizational units.
Because you can apply overlapping policy settings to any computer or user, the Group Policy feature generates a resulting set of policy settings when the user logs on. The gpresult command displays the resulting set of policy settings that were enforced on the computer for the specified user when the user logged on.
Because /v and /z produce a lot of information, it's useful to redirect output to a text file (for example, gpresult/z >policy.txt
).
On ARM64 versions of Windows, only the gpresult
in SysWow64 works with the /h
parameter.
To retrieve RSoP data for only the remote user, maindom\hiropln with the password p@ssW23, who's on the computer srvmain, type:
gpresult /s srvmain /u maindom\hiropln /p p@ssW23 /user targetusername /scope user /r
To save all available information about Group Policy to a file named, policy.txt, for only the remote user maindom\hiropln with the password p@ssW23, on the computer srvmain, type:
gpresult /s srvmain /u maindom\hiropln /p p@ssW23 /user targetusername /z > policy.txt
To display RSoP data for the logged on user, maindom\hiropln with the password p@ssW23, for the computer srvmain, type:
gpresult /s srvmain /u maindom\hiropln /p p@ssW23 /r
The gettype command has been deprecated, and isn't guaranteed to be supported in Windows.
This tool is included in Windows Server 2003. For more information, see gettype.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sets or displays the file transfer type. The ftp command supports both ASCII (default) and binary image file transfer types:
We recommend using ASCII when transferring text files. In ASCII mode, character conversions to and from the network standard character set are performed. For example, end-of-line characters are converted as necessary, based on the target operating system.
We recommend using binary when transferring executable files. In binary mode, files are transferred in one-byte units.
type [<typename>]
Parameter | Description |
---|---|
[<typename>] |
Specifies the file transfer type. If you don't specify this parameter, the current type is displayed. |
To set the file transfer type to ASCII, type:
type ascii
To set the transfer file type to binary, type:
type binary
Removes a section of the registry that was loaded using the reg load operation.
reg unload <keyname>
Parameter | Description |
---|---|
<keyname> |
Specifies the full path of the subkey. To specify a remote computer, include the computer name (in the format `\ |
/? | Displays help at the command prompt. |
To unload the hive TempHive in the file HKLM, type:
reg unload HKLM\TempHive
[!CAUTION] Don't edit the registry directly unless you have no alternative. The registry editor bypasses standard safeguards, allowing settings that can degrade performance, damage your system, or even require you to reinstall Windows. You can safely alter most registry settings by using the programs in Control Panel or Microsoft Management Console (MMC). If you must edit the registry directly, back it up first.
<!-- Copies -->
a registry entry to a specified location on the local or remote computer.
reg copy <keyname1> <keyname2> [/s] [/f]
Parameter | Description |
---|---|
<keyname1> |
Specifies the full path of the subkey or entry to be added. To specify a remote computer, include the computer name (in the format `\ |
<keyname2> |
Specifies the full path of the second subkey to be compared. To specify a remote computer, include the computer name (in the format `\ |
/s | Copies all subkeys and entries under the specified subkey. |
/f | Copies the subkey without prompting for confirmation. |
/? | Displays help at the command prompt. |
This command doesn't ask for confirmation when copying a subkey.
The return values for the reg compare operation are:
| Value | Description | |--|--| | 0 | Success | | 1 | Failure |
To copy all subkeys and values under the key MyApp to the key SaveMyApp, type:
reg copy HKLM\Software\MyCo\MyApp HKLM\Software\MyCo\SaveMyApp /s
To copy all values under the key MyCo on the computer named ZODIAC to the key MyCo1 on the current computer, type:
reg copy \\ZODIAC\HKLM\Software\MyCo HKLM\Software\MyCo1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Ends the ftp session with the remote computer, and then exits.
[!NOTE] This command is the same as the ftp bye command.
quit
To end the ftp session with the remote computer and return to the operating system command prompt, type:
quit
Copies the specified subkeys, entries, and values of the local computer into a file for transfer to other servers.
reg export <keyname> <filename> [/y]
Parameter | Description |
---|---|
<keyname> |
Specifies the full path of the subkey. The export operation only works with the local computer. The keyname must include a valid root key. Valid root keys for the local computer are: HKLM, HKCU, HKCR, HKU, and HKCC. If the registry key name contains a space, enclose the key name in quotes. |
<filename> |
Specifies the name and path of the file to be created during the operation. The file must have a .reg extension. |
/y | Overwrites any existing file with the name filename without prompting for confirmation. |
/? | Displays help at the command prompt. |
To export the contents of all subkeys and values of the key MyApp to the file AppBkUp.reg, type:
reg export HKLM\Software\MyCo\MyApp AppBkUp.reg
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Connects to the specified ftp server.
open <computer> [<port>]
Parameter | Description |
---|---|
<computer> |
Specifies the remote computer to which you are trying to connect. You can use an IP address or computer name (in which case a DNS server or Hosts file must be available). |
[<port>] |
Specifies a TCP port number to use to connect to an ftp server. By default, TCP port 21 is used. |
To connect to the ftp server at ftp.microsoft.com, type:
open ftp.microsoft.com
To connect to the ftp server at ftp.microsoft.com that is listening on TCP port 755, type:
open ftp.microsoft.com 755
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Copies local files to the remote computer using the current file transfer type.
mput <localfile>[ ]
Parameter | Description |
---|---|
<localfile> |
Specifies the local file to copy to the remote computer. |
To copy Program1.exe and Program2.exe to the remote computer using the current file transfer type, type:
mput Program1.exe Program2.exe
Refreshes the state of all disks in a disk group, attempt to recover disks in an invalid disk group, and resynchronizes mirrored volumes and RAID-5 volumes that have stale data. This command operates on disks that are failed or failing. It also operates on volumes that are failed, failing, or in failed redundancy state.
This command operates on groups of dynamic disks. If this command is used on a group with a basic disk, it won't return an error, but no action will be taken.
[!NOTE] A disk that is part of a disk group must be selected for this operation to succeed. Use the select disk command to select a disk and shift the focus to it.
recover [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To recover the disk group that contains the disk with focus, type:
recover
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a directory on the remote computer.
mkdir <directory>
Parameter | Description |
---|---|
<directory> |
Specifies the name of the new remote directory. |
To create a directory called dir1 on the remote computer, type:
mkdir dir1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Sends verbatim arguments to the remote ftp server. A single ftp reply code is returned.
[!NOTE] This command is the same as the ftp quote command.
literal <argument> [ ]
Parameter | Description |
---|---|
<argument> |
Specifies the argument to send to the ftp server. |
To send a quit command to the remote ftp server, type:
literal quit
Displays information about the selected disk, partition, volume, or virtual hard disk (VHD).
detail disk
detail partition
detail volume
detail vdisk
Parameter | Description |
---|---|
Detail disk | Displays the properties of the selected disk and the volumes on that disk. |
Detail partition | Displays the properties of the selected partition. |
Detail volume | Displays the disks on which the current volume resides. |
Detail vdisk | Displays the properties of the selected VHD. |
Deletes the selected volume. Before you begin, you must select a volume for this operation to succeed. Use the select volume command to select a volume and shift the focus to it.
[!IMPORTANT] You can't delete the system volume, boot volume, or any volume that contains the active paging file or crash dump (memory dump).
delete volume [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To delete the volume with focus, type:
delete volume
Recreates the default Group Policy Objects (GPOs) for a domain. To get to the Group Policy Management Console (GPMC), you must install Group Policy Management as a feature through Server Manager.
[!IMPORTANT] As a best practice, you should configure the Default Domain Policy GPO only to manage the default Account Policies settings, Password Policy, Account Lockout Policy, and Kerberos Policy. Additionally, you should configure the Default Domain Controllers Policy GPO only to set user rights and audit policies.
dcgpofix [/ignoreschema] [/target: {domain | dc | both}] [/?]
Parameter | Description | ||
---|---|---|---|
/ignoreschema | Ignores the version of the Active Directory schema when you run this command. Otherwise, the command only works on the same schema version as the Windows version in which the command was shipped. | ||
`/target {domain | dc | both` | Specifies whether to target the Default Domain policy, the Default Domain Controllers policy, or both types of policies. |
/? | Displays Help at the command prompt. |
To manage the default Account Policies settings, Password Policy, Account Lockout Policy, and Kerberos Policy, while ignoring the Active Directory schema version, type:
dcgpofix /ignoreschema /target:domain
To configure the Default Domain Controllers Policy GPO only to set user rights and audit policies, while ignoring the Active Directory schema version, type:
dcgpofix /ignoreschema /target:dc
Converts an empty basic disk with the GUID Partition Table (GPT) partition style into a basic disk with the master boot record (MBR) partition style. A basic disk must be selected for this operation to succeed. Use the select disk command to select a basic disk and shift the focus to it.
[!IMPORTANT] The disk must be empty to convert it to a basic disk. Back up your data, and then delete all partitions or volumes before converting the disk.
[!NOTE] For instructions regarding how to use this command, see Change a GUID Partition Table Disk into a Master Boot Record Disk.
convert mbr [noerr]
Parameter | Description |
---|---|
noerr | For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code. |
To convert a basic disc from GPT partition style to MBR partition style, type>:
convert mbr
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.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Specifies the operating system entry to designate as the default.
bootcfg /default [/s <computer> [/u <domain>\<user> /p <password>]] [/id <osentrylinenum>]
Parameter | Description |
---|---|
/s <computer> |
Specifies the name or IP address of a remote computer (don't use backslashes). The default is the local computer. |
/u <domain>\<user> |
Runs the command with the account permissions of the user specified by <user> or <domain>\<user> . The default is the permissions of the current logged on user on the computer issuing the command. |
/p <password> |
Specifies the password of the user account that is specified in the /u parameter. |
/id <osentrylinenum> |
Specifies the operating system entry line number in the [operating systems] section of the Boot.ini file to which the operating system load options are added. The first line after the [operating systems] section header is 1. |
/? | Displays help at the command prompt. |
To use the bootcfg /default command:
bootcfg /default /id 2
bootcfg /default /s srvmain /u maindom\hiropln /p p@ssW23 /id 2
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Wraps any line of output text extending beyond the rightmost edge of the command window to the next line. You must specify this switch before any other switches.
By default, all switches except the bitsadmin monitor switch, wrap the output text.
bitsadmin /wrap <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve information for the job named myDownloadJob and wrap the output text:
bitsadmin /wrap /info myDownloadJob /verbose
Enables or disables the BITS client analytic channel.
bitsadmin /util /enableanalyticchannel TRUE|FALSE
Parameter | Description |
---|---|
TRUE or FALSE | TRUE turns on content validation for the specified file, while FALSE turns it off. |
To turn the BITS client analytic channel on or off.
bitsadmin /util / enableanalyticchannel TRUE
Lets a user with administrative privileges take ownership of the specified job.
bitsadmin /takeownership <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To take ownership of the job named myDownloadJob:
bitsadmin /takeownership myDownloadJob
Sets the content validation state of the given file within the job.
bitsadmin /setvalidationstate <job> <file_index> <TRUE|FALSE>
Parameter | Description |
---|---|
Job | The job's display name or GUID. |
file_index | Starts at 0. |
TRUE or FALSE | TRUE turns on content validation for the specified file, while FALSE turns it off. |
To set the content validation state of file 2 to TRUE for the job named myDownloadJob:
bitsadmin /setvalidationstate myDownloadJob 2 TRUE
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Suspends the specified job. If you suspended your job by mistake, you can use the bitsadmin resume switch to restart the job.
bitsadmin /suspend <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To suspend the job named myDownloadJob:
bitsadmin /suspend myDownloadJob
Sets flags that determine if the files of the job can be cached and served to peers and if the job can download content from peers.
bitsadmin /setpeercachingflags <job> <value>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
value | An unsigned integer, including:
|
To allow the job named myDownloadJob to download content from peers:
bitsadmin /setpeercachingflags myDownloadJob 1
Sets the HTTP verb to use.
bitsadmin /sethttpmethod <job> <httpmethod>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
httpmethod | The HTTP verb to use. For information about available verbs, see Method Definitions. |
Sets the display name for the specified job.
bitsadmin /setdisplayname <job> <display_name>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
display_name | Text used as the displayed name for the specific job. |
To set the display name for the job to myDownloadJob:
bitsadmin /setdisplayname myDownloadJob
Activates a new or suspended job in the transfer queue. If you resumed your job by mistake, or simply need to suspend your job, you can use the bitsadmin suspend switch to suspend the job.
bitsadmin /resume <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To resume the job named myDownloadJob:
bitsadmin /resume myDownloadJob
Suspends the processing of a batch program, displaying the prompt, Press any key to continue . . .
pause
Parameter | Description |
---|---|
/? | Displays help at the command prompt. |
If you press CTRL+C to stop a batch program, the following message appears, Terminate batch job (Y/N)?
. If you press Y (for yes) in response to this message, the batch program ends and control returns to the operating system.
You can insert the pause command before a section of the batch file that you might not want to process. When pause suspends processing of the batch program, you can press CTRL+C and then press Y to stop the batch program.
To create a batch program that prompts the user to change disks in one of the drives, type:
@echo off
:Begin
copy a:*.*
echo Put a new disk into Drive A
pause
goto begin
In this example, all the files on the disk in Drive A are copied to the current directory. After the message prompts you to put a new disk in Drive A, the pause command suspends processing so that you can change disks and then press any key to resume processing. This batch program runs in an endless loop—the goto begin command sends the command interpreter to the Begin label of the batch file.
Gets the configuration flags that determine if the computer serves content to peers and if it can download content from peers.
bitsadmin /peercaching /getconfigurationflags <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To get the configuration flags for the job named myDownloadJob:
bitsadmin /peercaching /getconfigurationflags myDownloadJob
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Lists the /peercaching switches.
Lists the /peercaching switches.
bitsadmin /peercaching /help
bitsadmin /peercaching /setconfigurationflags
bitsadmin /peercaching /getconfigurationflags
Parameter | Description |
---|---|
bitsadmin peercaching and help | Displays the command-line usage for the /peercaching switches. |
bitsadmin peercaching and setconfigurationflags | Sets the configuration flags that determine if the computer can serve content to peers and if it can download content from peers. |
bitsadmin peercaching and getconfigurationflags | Gets the configuration flags that determine if the computer serves content to peers and if it can download content from peers. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the resource record type for the query. For information about resource record types, see Request for Comment (Rfc) 1035.
[!NOTE] This command is the same as the nslookup set querytype command.
set type=<resourcerecordtype>
Parameter | Description |
---|---|
<resourcerecordtype> |
Specifies a DNS resource record type. The default resource record type is A, but you can use any of the following values:
|
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Displays help-related information about the bitsadmin command-line parameters and options.
bitsadmin /help | /?
To retrieve the command-line help.
bitsadmin /help
Displays progress while a command is running. You can use /progress with any other wdsutil commands that you run. If you want to turn on verbose logging for this command, you must specify /verbose and /progress directly after wdsutil.
wdsutil /progress <commands>
To initialize the server and display progress, type:
wdsutil /verbose /progress /Initialize-Server /Server:MyWDSServer /RemInst:C:\RemoteInstall
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates a new multicast transmission for an image. This command is equivalent to creating a transmission by using the Windows Deployment Services mmc snap-in (right-click the Multicast Transmissions node, and then click create Multicast Transmission). You should use this command when you have both the Deployment Server role service and the Transport Server role service installed (which is the default installation). If you have only the Transport Server role service installed, use wdsutilnew-Namespace command.
For install images transmissions:
wdsutil [Options] /New-MulticastTransmissiomedia:<Image name>
[/Server:<Server name>]
/FriendlyName:<Friendly name>
[/Description:<Description>]
/Transmissiontype: {AutoCast | ScheduledCast}
[/time:<YYYY/MM/DD:hh:mm>]
[/Clients:<Num of Clients>]
imagetype:Install
ImageGroup:<Image Group>]
[/Filename:<File name>]
For boot image transmissions (only supported for Windows Server 2008 R2):
wdsutil [Options] /New-MulticastTransmissiomedia:<Image name>
[/Server:<Server name>]
/FriendlyName:<Friendly name>
[/Description:<Description>]
/Transmissiontype: {AutoCast | ScheduledCast}
[/time:<YYYY/MM/DD:hh:mm>]
[/Clients:<Num of Clients>]
imagetype:Boot
/Architecture:{x86 | ia64 | x64}
[/Filename:<File name>]
Parameter | Description |
---|---|
/image:<Image name> | Specifies the name of the image to be transmitted using multicasting. |
[/Server:<Server name>] | Specifies the name of the server. This can be the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
/FriendlyName:<Friendly name> | Specifies the friendly name of the transmission. |
[/Description:<Description>] | Specifies the description of the transmission. |
/imagetype:{Boot|Install} | Specifies the type of image to be transmitted using multicasting. Note Boot is only supported for Windows Server 2008 R2. |
/ImageGroup:<Image group name>] | Specifies the image group that contains the image. If no image group name is specified and only one image group exists on the server, that image group is used. If more than one image group exists on the server, you must use this option to specify the image group name. |
[/Filename:<File name>] | Specifies the file name. If the source image cannot be uniquely identified by name, you must use this option to specify the file name. |
/Transmissiontype:{AutoCast | ScheduledCast} | Specifies whether to start the transmission automatically (AutoCast) or based on the specified start criteria (ScheduledCast).
|
/Architecture:{x86 | ia64 | x64} | Specifies the architecture of the boot image to transmit using multicasting. Because it is possible to have the same name for boot images of different architectures, you should specify the architecture to ensure the correct image is used. |
[/Filename:<File name>] | Specifies the file name. If the source image cannot be uniquely identified by name, you must specify the file name. |
To create an Auto-Cast transmission of a boot image in Windows Server 2008 R2, type:
wdsutil /New-MulticastTransmission /FriendlyName:WDS Boot Transmission
/Image:X64 Boot imagetype:Boot /Architecture:x64 /Transmissiontype:AutoCast
To create an Auto-Cast transmission of an install image, type:
wdsutil /New-MulticastTransmission /FriendlyName:WDS AutoCast Transmission
/Image:Vista with Officeimage imagetype:Install /Transmissiontype:AutoCast
To create a Scheduled-Cast transmission of an install image, type:
wdsutil /New-MulticastTransmission /FriendlyName:WDS SchedCast Transmission /Server:MyWDSServer Image:Vista with Office imagetype:Install
/Transmissiontype:ScheduledCast /time:2006/11/20:17:00 /Clients:100
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Configures a Windows Deployment Services server for initial use after the server role has been installed. After you run this command, you should use the wdsutil add-Image command command to add images to the server.
wdsutil /Initialize-Server [/Server:<Server name>] /remInst:<Full path> [/Authorize]
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
/remInst:<Full path> | Specifies the full path and name of the remoteInstall folder. If the specified folder does not already exist, this option will create it when the command is run. You should always enter a local path, even in the case of a remote computer. For example: D:\remoteInstall. |
[/Authorize] | Authorizes the server in Dynamic Host Control Protocol (DHCP). This option is necessary only if DHCP rogue detection is enabled, meaning that the Windows Deployment Services PXE server must be authorized in DHCP before client computers can be serviced. Note that DHCP rogue detection is disabled by default. |
To initialize the server and set the remoteInstall shared folder to the F: drive, type.
wdsutil /Initialize-Server /remInst:F:\remoteInstall
To initialize the server and set the remoteInstall shared folder to the C: drive, type.
wdsutil /verbose /Progress /Initialize-Server /Server:MyWDSServer /remInst:C:\remoteInstall
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Retrieves information from the specified Windows Deployment Services server.
wdsutil [Options] /Get-Server [/Server:<Server name>] /Show:{Config | Images | All} [/detailed]
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server is used. |
/Show:{Config | Images | All} | Specifies the type of information to return. - Config returns configuration information. |
[/detailed] | You can use this option with /Show:Images or /Show:All to indicate that all image metadata from each image should be returned. If the /detailed option is not used, the default behavior is to return the image name, description, and file name. |
To view information about the server, type:
wdsutil /Get-Server /Show:Config
To view detailed information about the server, type:
wdsutil /verbose /Get-Server /Server:MyWDSServer /Show:All /detailed
Displays information about a driver package, including the drivers and files it contains.
wdsutil /Get-DriverPackageFile /InfFile:<Inf File path> [/Architecture:{x86 | ia64 | x64}] [/Show:{Drivers | Files | All}]
Parameter | Description |
---|---|
/InfFile:<Inf File path> | Specifies the full path and file name of the driver package .inf file. |
[/Architecture:{x86 | ia64 |
[/Show: {Drivers | Files |
To view information about a driver file, type:
wdsutil /Get-DriverPackageFile /InfFile:C:\temp\1394.inf /Architecture:x86
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays the Windows Deployment Services properties of all pre-staged computers. A pre-staged computer is a physical computer that has been linked to a computer account in active directory Domain Services.
wdsutil [options] /get-alldevices [/forest:{Yes | No}] [/referralserver:<servername>]
Parameter | Description | |
---|---|---|
`[/forest:{Yes | No}]` | Specifies whether Windows Deployment Services should return computers in the entire forest or the local domain. The default setting is No, meaning that only the computers in the local domain are returned. |
[/referralserver:<servername>] |
Returns only those computers that are pre-staged for the specified server. |
To view all computers, type either:
wdsutil /get-alldevices
wdsutil /verbose /get-alldevices /forest:Yes /referralserver:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Enables all services for the Transport Server.
wdsutil [options] /Enable-TransportServer [/Server:<Servername>]
Parameter | Description |
---|---|
[/Server:<Servername> ] |
Specifies the name of the server. This can be the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server is used. |
To enable the services on the server, type either:
wdsutil /Enable-TransportServer
wdsutil /verbose /Enable-TransportServer /Server:MyWDSServer
Converts an existing Remote Installation Preparation (RIPrep) image to Windows Image (.wim) format.
wdsutil [Options] /Convert-RIPrepImage /FilePath:<Filepath and name> /DestinationImage /FilePath:<Filepath and name> [/Name:<Name>] [/Description:<Description>] [/InPlace] [/Overwrite:{Yes | No | Append}]
Parameter | Description | ||
---|---|---|---|
/FilePath:<Filepath and name> |
Specifies the full filepath and name of the .sif file that corresponds to the RIPrep image. This file is typically called Riprep.sif and is found in the \Templates subfolder of the folder that contains the RIPrep image. | ||
/DestinationImage | Specifies the settings for the destination image. Uses the following options;
|
No | Append}` - Sets whether this image should overwrite or append any existing files. |
To convert the specified RIPrep.sif image to RIPREP.wim, type:
wdsutil /Convert-RiPrepImage /FilePath:R:\RemoteInstall\Setup\English \Images\Win2k3.SP1\i386\Templates\riprep.sif /DestinationImage /FilePath:C:\Temp\RIPREP.wim
To convert the specified RIPrep.sif image to RIPREP.wim with the specified name and description, and overwrite it with the new file if a file already exists, type:
wdsutil /Verbose /Progress /Convert-RiPrepImage /FilePath:\\Server \RemInst\Setup\English\Images\WinXP.SP2\i386\Templates\riprep.sif /DestinationImage /FilePath:\\Server\Share\RIPREP.wim /Name:WindowsXP image /Description:Converted RIPREP image of WindowsXP /Overwrite:Append
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Adds a driver package that is in the driver store to an existing boot image on the server.
wdsutil /add-ImageDriverPackage [/Server:<Servername>] [media:<Imagename>] [mediatype:Boot] [/Architecture:{x86 | ia64 | x64}] [/Filename:<Filename>] {/DriverPackage:<Package Name> | /PackageId:<ID>}
Parameter | Description | ||
---|---|---|---|
[/Server:<Servername> ] |
Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If a server name is not specified, the local server is used. | ||
[media:<Imagename> ] |
Specifies the name of the image to add the driver to. | ||
[mediatype:Boot] | Specifies the type of image to add the driver to. Driver packages can only be added to boot images. | ||
[/Architecture:`{x86 | ia64 | x64}`] | Specifies the architecture of the boot image. Because it's possible to have the same image name for boot images in different architectures, you should specify the architecture to ensure the correct image is used. |
[/Filename:<Filename> ] |
Specifies the name of the file. If the image cannot be uniquely identified by name, the file name must be specified. | ||
[/DriverPackage:<Name> |
Specifies the name of the driver package to add to the image. | ||
[/PackageId:<ID> ] |
Specifies the Windows Deployment Services ID of the driver package. You must specify this option if the driver package can't be uniquely identified by name. To find the Package ID, select the driver group that the package is in (or the All Packages node), right-click the package, and then select Properties. The Package ID is listed on the General tab. For example: {DD098D20-1850-4fc8-8E35-EA24A1BEFF5E}. |
To add a driver package to a boot image, type either:
wdsutil /add-ImageDriverPackagmedia:WinPE Boot Imagemediatype:Boot /Architecture:x86 /DriverPackage:XYZ
wdsutil /verbose /add-ImageDriverPackagmedia:WinPE Boot Image /Server:MyWDSServemediatype:Boot /Architecture:x64 /PackageId:{4D36E972-E325-11CE-Bfc1-08002BE10318}
Changes the position of batch parameters in a batch file.
shift [/n <N>]
Parameter | Description |
---|---|
/n <N> |
Specifies to start shifting at the Nth argument, where N is any value from 0 to 8. Requires command extensions, which are enabled by default. |
/? | Displays help at the command prompt. |
The shift command changes the values of the batch parameters %0 through %9 by copying each parameter into the previous one—the value of %1 is copied to %0, the value of %2 is copied to %1, and so on. This is useful for writing a batch file that performs the same operation on any number of parameters.
If command extensions are enabled, the shift command supports the /n command-line option. The /n option specifies to start shifting at the Nth argument, where N is any value from 0 to 8. For example, SHIFT /2 would shift %3 to %2, %4 to %3, and so on, and leave %0 and %1 unaffected. Command extensions are enabled by default.
You can use the shift command to create a batch file that can accept more than 10 batch parameters. If you specify more than 10 parameters on the command line, those that appear after the tenth (%9) will be shifted one at a time into %9.
The shift command has no effect on the %* batch parameter.
There's no backward shift command. After you implement the shift command, you can't recover the batch parameter (%0) that existed before the shift.
To use a batch file, called Mycopy.bat, to copy a list of files to a specific directory, type:
@echo off
rem MYCOPY.BAT copies any number of files
rem to a directory.
rem The command uses the following syntax:
rem mycopy dir file1 file2 ...
set todir=%1
:getfile
shift
if "%1"=="" goto end
copy %1 %todir%
goto getfile
:end
set todir=
echo All done
Creates a directory or file symbolic or hard link.
mklink [[/d] | [/h] | [/j]] <link> <target>
Parameter | Description |
---|---|
/d | Creates a directory symbolic link. By default, this command creates a file symbolic link. |
/h | Creates a hard link instead of a symbolic link. |
/j | Creates a Directory Junction. |
<link> |
Specifies the name of the symbolic link being created. |
<target> |
Specifies the path (relative or absolute) that the new symbolic link refers to. |
/? | Displays help at the command prompt. |
To create and remove a symbolic link named MyFolder from the root directory to the \Users\User1\Documents directory, and a hard link named Myfile.file to the example.file file located within the directory, type:
mklink /d \MyFolder \Users\User1\Documents
mklink /h \MyFile.file \User1\Documents\example.file
rd \MyFolder
del \MyFile.file
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Resets (deletes) a session on a Remote Desktop Session Host server.
[!NOTE] This command is the same as the reset session command.
[!NOTE] To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server.
Creates an operating system image by pulling the files from the original Windows Server 2003 CD or from a customized distribution folder containing these files.
[!IMPORTANT] The rexec command has been deprecated, and isn't guaranteed to be supported in Windows.
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Changes the default Domain Name System (DNS) domain name and search list. This command overrides the default DNS domain name and search list of the nslookup set domain command.
set srchlist=<domainname>[/...]
Parameter | Description |
---|---|
<domainname> |
Specifies new names for the default DNS domain and search list. The default domain name value is based on the host name. You can specify a maximum of six names separated by slashes (/). |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
To set the DNS domain to mfg.widgets.com and the search list to the three names:
set srchlist=mfg.widgets.com/mrp2.widgets.com/widgets.com
Displays summary information about the specified job.
bitsadmin /info <job> [/verbose]
Parameter | Description |
---|---|
job | The job's display name or GUID. |
/verbose | Optional. Provides detailed information about each job. |
To retrieve information about the job named myDownloadJob:
bitsadmin /info myDownloadJob
Reports the content validation state of the given file within the job.
bitsadmin /getvalidationstate <job> <file_index>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
file_index | Starts from 0. |
To retrieve the content validation state of file 2 within the job named myDownloadJob:
bitsadmin /getvalidationstate myDownloadJob 1
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Reports the HTTP security flags for URL redirection and checks performed on the server certificate during the transfer.
bitsadmin /getsecurityflags <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the security flags from a job named myDownloadJob:
bitsadmin /getsecurityflags myDownloadJob
Retrieves the server's upload-reply data in hexadecimal format for the job.
[!NOTE] This command isn't supported by BITS 1.2 and earlier.
bitsadmin /getreplydata <job>
Parameter | Description |
---|---|
job | The job's display name or GUID. |
To retrieve the upload-reply data for the job named myDownloadJob:
bitsadmin /getreplydata myDownloadJob
Connects with the finger server on the current device.
finger [<username>] [{[>] <filename> | [>>] <filename>}]
Parameter | Description |
---|---|
<username> |
Specifies the name of the user to look up. |
<filename> |
Specifies a file name in which to save the output. You can use the greater than (> ) and double greater than (>> ) characters to redirect the output in the usual manner. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Verifies that a writer or component is included or excludes a writer or component from the backup or restore procedure. If used without parameters, writer displays help at the command prompt.
writer verify [writer> | <component>]
writer exclude [<writer> | <component>]
Parameter | Description |
---|---|
verify | Verifies that the specified writer or component is included in the backup or restore procedure. The backup or restore procedure will fail if the writer or component is not included. |
exclude | Excludes the specified writer or component from the backup or restore procedure. |
To verify a writer by specifying its GUID (for this example, 4dc3bdd4-ab48-4d07-adb0-3bee2926fd7f), type:
writer verify {4dc3bdd4-ab48-4d07-adb0-3bee2926fd7f}
To exclude a writer with the name System Writer, type:
writer exclude System Writer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Configure and manage your Network Load Balancing clusters and all cluster hosts from a single computer, using the Network Load Balancing Manager. You can also use this command to replicate the cluster configuration to other hosts.
You can start the Network Load Balancing Manager from the command-line using the command nlbmgr.exe, which is installed in the systemroot\System32 folder.
nlbmgr [/noping][/hostlist <filename>][/autorefresh <interval>][/help | /?]
Parameter | Description |
---|---|
/noping | Prevents the Network Load Balancing Manager from pinging the hosts prior to trying to contact them through Windows Management Instrumentation (WMI). Use this option if you have disabled Internet Control Message Protocol (ICMP) on all available network adapters. If the Network Load Balancing Manager attempts to contact a host that isn't available, you'll experience a delay when using this option. |
/hostlist <filename> |
Loads the hosts specified in filename into the Network Load Balancing Manager. |
/autorefresh <interval> |
Causes the Network Load Balancing Manager to refresh its host and cluster information every <interval> seconds. If no interval is specified, the information is refreshed every 60 seconds. |
/? | Displays help at the command prompt. |
/help | Displays help at the command prompt. |
Displays user, group and privileges information for the user who is currently logged on to the local system. If used without parameters, whoami displays the current domain and user name.
whoami [/upn | /fqdn | /logonid]
whoami {[/user] [/groups] [/priv]} [/fo <Format>] [/nh]
whoami /all [/fo <Format>] [/nh]
Parameter | Description |
---|---|
/upn | Displays the user name in user principal name (UPN) format. |
/fqdn | Displays the user name in fully qualified domain name (FQDN) format. |
/logonid | Displays the logon ID of the current user. |
/user | Displays the current domain and user name and the security identifier (SID). |
/groups | Displays the user groups to which the current user belongs. |
/priv | Displays the security privileges of the current user. |
/fo <Format> | Specifies the output format. Valid values include:table Displays output in a table. This is the default value.list Displays output in a list.csv Displays output in comma-separated value (CSV) format. |
/all | Displays all information in the current access token, including the current user name, security identifiers (SID), privileges, and groups that the current user belongs to. |
/nh | Specifies that the column header should not be displayed in the output. This is valid only for table and CSV formats. |
/? | Displays help at the command prompt. |
To display the domain and user name of the person who is currently logged on to this computer, type:
whoami
Output similar to the following appears:
DOMAIN1\administrator
To display all of the information in the current access token, type:
whoami /all
Updates files in the REMINST shared folder by using the latest files that are stored in the server's %Windir%\System32\RemInst folder. To ensure the validity of your Windows Deployment Services installation, you should run this command once after each server upgrade, service pack installation, or update to Windows Deployment Services files.
wdsutil [Options] /Update-ServerFiles [/Server:<Server name>]
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
To update the files, type one of the following:
wdsutil /Update-ServerFiles
wdsutil /Verbose /Progress /Update-ServerFiles /Server:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Starts all services for a Transport Server.
wdsutil [Options] /start-TransportServer [/Server:<Server name>]
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the Transport Server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
To start the server, type one of the following:
wdsutil /start-TransportServer
wdsutil /verbose /start-TransportServer /Server:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Stops all services on a Transport Server.
wdsutil [Options] /Stop-TransportServer [/Server:<Server name>]
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the Transport Server. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no Transport Server is specified, the local server will be used. |
To stop the services, type one of the following:
wdsutil /Stop-TransportServer
wdsutil /verbose /Stop-TransportServer /Server:MyWDSServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Starts all services for a Windows Deployment Services server.
wdsutil [Options] /start-Server [/Server:<Server name>]
Parameter | Description |
---|---|
[/Server:<Server name>] | Specifies the name of the server to be started. This can be either the NetBIOS name or the fully qualified domain name (FQDN). If no server name is specified, the local server will be used. |
To start the server, type one of the following:
wdsutil /start-Server
wdsutil /verbose /start-Server /Server:MyWDSServer
Removes a driver group from a server.
wdsutil /Remove-DriverGroup /DriverGroup:<Group Name> [/Server:<Server name>]
Parameter | Description |
---|---|
/DriverGroup:<Group Name> | Specifies the name of the driver group to remove. |
[/Server:<Server name>] | Specifies the name of the server. This can be the NetBIOS name or the FQDN. If a server name is not specified, the local server is used. |
To remove a driver group, type one of the following:
wdsutil /Remove-DriverGroup /DriverGroup:PrinterDrivers
wdsutil /Remove-DriverGroup /DriverGroup:PrinterDrivers /Server:MyWdsServer
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Creates capture and discover images, multicast transmissions, and namespaces.
Subcommand | Description |
---|---|
wdsutil new-captureimage command | creates a new capture image from an existing boot image. |
wdsutil new-discoverimage command | creates a new discover image from an existing boot image. |
wdsutil new-multicasttransmission command | creates a new multicast transmission. |
wdsutil new-namespace command | creates a new namespace. |
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012
Displays information about all the driver groups on a server.
wdsutil /get-alldrivergroups [/server:<servername>] [/show:{packagemetadata | filters | all}]
Parameter | Description | ||
---|---|---|---|
[/server:<servername>] |
Specifies the name of the server. This can be the NetBIOS name or the FQDN. If a server name is not specified, the local server is used. | ||
`/show:{packagemetadata | filters | all}]` | Displays the metadata for all the driver packages in the specified group. PackageMetaData displays information about all the filters for the driver group. Filters displays the metadata for all driver packages and filte |