- Windows commands
- Prerequisites
- Command shell overview
- Command-line reference A-Z
- Windows 10 IoT Core Command Line Utils
- IoT Core-specific Command Line Utils
- Setting startup app:
- Change settings for region and user or speech language:
- Change default audio device and volume:
- Manually installing .APPX files:
- General Command Line Utils
- Update account password:
- Create local user accounts:
- Set password:
- Query and set device name:
- Basic network configuration:
- Copy utilities:
- Process Management:
- Set Boot Option (Headless vs. headed boot):
- Task scheduler:
- Device drivers:
- Registry Access:
- Services:
- Boot configuration:
- Shutdown/restart device:
- Viewing and changing display settings
- Take screenshot:
- Get information about Network Adapters:
- Set folder permissions for UWP apps:
- Work with Serial Ports:
- Command-Line Reference
- Prerequisites
- Feature description
- New and deprecated functionality
- Command shell overview
- Customize the Command Prompt window
- To configure the Command Prompt window
- Command-line reference A-Z
Windows commands
All supported versions of Windows (server and client) have a set of Win32 console commands built in.
This set of documentation describes the Windows Commands you can use to automate tasks by using scripts or scripting tools.
Prerequisites
The information that is contained in this topic applies to:
- Windows Server 2019
- Windows Server (Semi-Annual Channel)
- Windows Server 2016
- Windows Server 2012 R2
- Windows Server 2012
- Windows Server 2008 R2
- Windows Server 2008
- Windows 10
- Windows 8.1
Command shell overview
The Command shell was the first shell built into Windows to automate routine tasks, like user account management or nightly backups, with batch (.bat) files. With Windows Script Host you could run more sophisticated scripts in the Command shell. For more information, see cscript or wscript. You can perform operations more efficiently by using scripts than you can by using the user interface. Scripts accept all Commands that are available at the command line.
Windows has two command shells: The Command shell and PowerShell. Each shell is a software program that provides direct communication between you and the operating system or application, providing an environment to automate IT operations.
PowerShell was designed to extend the capabilities of the Command shell to run PowerShell commands called cmdlets. Cmdlets are similar to Windows Commands but provide a more extensible scripting language. You can run Windows Commands and PowerShell cmdlets in Powershell, but the Command shell can only run Windows Commands and not PowerShell cmdlets.
For the most robust, up-to-date Windows automation, we recommend using PowerShell instead of Windows Commands or Windows Script Host for Windows automation.
You can also download and install PowerShell Core, the open source version of PowerShell.
Incorrectly editing the registry may severely damage your system. Before making the following changes to the registry, you should back up any valued data on the computer.
To enable or disable file and directory name completion in the Command shell on a computer or user logon session, run regedit.exe and set the following reg_DWOrd value:
To set the reg_DWOrd value, use the hexadecimal value of a control character for a particular function (for example, 0 9 is Tab and 0 08 is Backspace). User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings.
Command-line reference A-Z
To find information about a specific command, in the following A-Z menu, click the letter that the command starts with, and then click the command name.
Windows 10 IoT Core Command Line Utils
Looking to configure some of the settings on your device? The below tools are available at your disposal. Use PowerShell to run these commands after connecting to your device.
These tools are not pre-loaded — you will need to include appropriate feature IDs to get these tools in the image.
IoT Core-specific Command Line Utils
Setting startup app:
Use the startup editor to configure startup apps on your Windows IoT Core device. Run IotStartup with any of the following options:
- IotStartup list lists installed applications
- IotStartup list headed lists installed headed applications
- IotStartup list headless lists installed headless applications
- IotStartup list [MyApp] list installed applications that match pattern MyApp
- IotStartup add adds headed and headless applications
- IotStartup add headed [MyApp] adds headed applications that match pattern MyApp . Pattern must match only one application.
- IotStartup add headless [Task1] adds headless applications that match pattern Task1
- IotStartup remove removes headed and headless applications
- IotStartup remove headed [MyApp] removes headed applications that match pattern MyApp
- IotStartup remove headless [Task1] removes headless applications that match pattern Task1
- IotStartup startup lists headed and headless applications registered for startup
- IotStartup startup [MyApp] lists headed and headless applications registered for startup that match pattern MyApp
- IotStartup startup headed [MyApp] lists headed applications registered for startup that match MyApp
- IotStartup startup headless [Task1] lists headless applications registered for startup that match Task1
- IotStartup run [MyApp] start app identified by MyApp
- IotStartup stop [MyApp] stop app identified by MyApp
- For further help, try IotStartup help
Change settings for region and user or speech language:
The IoTSettings tool changes region, user language, or speech language. This is a command line tool that can be invoked from an application using the ProcessLauncher API. These commands must be run as default account, not administrator.
- IotSettings del account
deletes all MSA or Azure AD accounts on the system or a specific account. Specific accounts take the form username@provider.com - IotSettings del diagnostics deletes diagnostic information in the cloud for the current device. Note that this removes the history up to the time of invocation. New diagnostics information will continue to be logged.
- IotSettings list account lists all MSA or Azure AD accounts that have been signed into the device.
- IotSettings list uilanguage lists all UI languages
- IotSettings list speechlanguage lists all speech languages
- IotSettings get uilanguage displays current UI language
- IotSettings get speechlanguage displays current speech language
- IotSettings get region displays current region
- IotSettings set uilanguage language\_tag — (e.g. fr-CA) sets default UI language French Canadian)
- IotSettings set speechlanguage language\_tag — (e.g. fr-CA) sets speech language French Canadian)
- IotSettings set region region\_code — (e.g. CA) sets default region to Canada)
- IotSettings set bluetoothpref
Specifies the Bluetooth role preference to select when devices built with both IOT_BLUETOOTH_A2DP_SOURCE and IOT_BLUETOOTH_A2DP_SINK features connect to another device that also supports both roles. - IotSettings get bluetoothpref returns the current Bluetooth role preference for devices built with both IOT_BLUETOOTH_A2DP_SOURCE and IOT_BLUETOOTH_A2DP_SINK. The default is source.
IoTSettings -list uiLanguage will give back the list of supported UI language (in the version of Windows IoT core image it has been executed against)
Change default audio device and volume:
The IoTCoreAudioControlTool tool controls audio related options, such as setting default capture and playback devices and changing the volume. For a full list of parameters, run IoTCoreAudioControlTool h .
Manually installing .APPX files:
DeployAppx enables installing, and removing in .APPX packages in development scenarios. The correct method for installing .APPX packages in production images is to use a provisioning package as documented in the Install your app subject. DeployAppx also supports querying .APPX package information.
- DeployAppx install MyApp.appx installs the .APPX and the certificate of the same name if found.
- DeployAppx install force MyApp.appx forces uninstalling the currently installed .APPX with the same package name if found before installing the new .APPX. This is useful for installing an .APPX with the same or lower version number as the currently installed .APPX.
- DeployAppx install retry MyApp.appx retry installing the .APPX 10 times on failure with 2-second delay between attempts.
- DeployAppx uninstall App_1.0.1.0_x86__publisherid123 uninstall the .appx with the matching package full name.
- DeployAppx uninstall MyApp.appx uninstall any installed .APPX with a matching package family name.
- DeployAppx getpackages lists installed package full names.
- DeployAppx getpackageid IotCoreDefaultApp.appx prints out the package name, the package family name, and the package full name for the .APPX.
- DeployAppx register appxmanifest.xml unsupported
General Command Line Utils
Update account password:
It is highly recommended that you update the default password for the Administrator account. To do this, you can issue the following command: net user Administrator [new password] where [new password] represents a strong password of your choice.
Create local user accounts:
If you wish to give others access to your Windows IoT Core device, you can create additional local user accounts using PS by typing in net user [username] [password] /add . If you wish to add this user to other groups, such as the Administrator group, use net localgroup Administrators [username] /add .
Set password:
To change the password on an account on your device, run net user [account-username] [new-password] to change the account password.
Query and set device name:
To identify your current device name, simply type hostname . To change the name of your Windows IoT Core device, type SetComputerName [new machinename] . You may need to restart your device for the name change to take effect.
Basic network configuration:
Many of the basic network configuration utilities you may already be familiar with are available in Windows IoT Core, including commands such as ping.exe , netstat.exe , netsh.exe , ipconfig.exe , tracert.exe , and arp.exe .
Copy utilities:
Microsoft is providing familiar tools, including sfpcopy.exe as well as xcopy.exe .
Process Management:
To view currently running processes, you can try either get-process or alternatively tlist.exe . To stop a running process, type kill.exe [pid or process name] .
Set Boot Option (Headless vs. headed boot):
Windows IoT Core devices can be set to headed (when display capabilities are required) or headless (when a display is not required or available) device mode. To change this setting, use setbootoption.exe [headed | headless] .
Changing this setting will require a reboot in order for the change to take effect.
Task scheduler:
To view the current list of scheduled tasks, use the schtasks.exe command. You can create new tasks with the /create switch or run on-demand tasks with the /run switch. For a full list of supported parameters, use schtasks.exe /?
Device drivers:
The device console utility is useful in identifying and managing installed devices and drivers. For a full list of parameters, use devcon.exe /?
Registry Access:
If you need to access the registry to view or modify settings, use the reg.exe /? Command for the full list of supported parameters.
Services:
Managing Windows services can be accomplished via the net.exe command. To see a list of running services, type net start . To start or stop a specific service, type net [start | stop] [service name] . Alternatively, you can also use the service control manager via sc.exe command.
Boot configuration:
You can make changes to the boot configuration of your Windows IoT Core device by using bcdedit.exe . For instance, you can enable testsigning with bcdedit –set testsigning on command.
Shutdown/restart device:
To shut down your device, type shutdown /s /t 0 . To restart the device, use the /r switch instead with the command shutdown /r /t 0 .
Viewing and changing display settings
The SetDisplayResolution tool may be used for listing the current display settings and to show the list of supported values. It can further be used for adjusting the display’s resolution, refresh rate and/or orientation to values supported by your platform. The utility accepts the following command line arguments:
- SetDisplayResolution Lists the current display resolution.
- SetDisplayResolution -list Lists supported display resolutions.
- SetDisplayResolution -orientation:[n] Change the display orientation, where n=0,90,180 or 270.
- SetDisplayResolution [width] [height] Change the width and height in pixels
- SetDisplayResolution [width] [height] [refreshrate] Change width, height, and refresh rate where width and height are in pixels and refreshrate in Hz
- SetDisplayResolution [width] [height] [refreshrate] [orientation] Change width, height, refreshrate and screen orientation where width and height are in pixels, refreshrate in Hz and orientation is one of 0, 90, 180 or 270.
Take screenshot:
You can take the screenshot of your Windows IoTCore device by using ScreenCapture.exe . For example, run ScreenCapture c:\folder\screencap.jpg will take the screenshot and save it in screencap.jpg file.
Get information about Network Adapters:
To view the list of all the available network adapters, run GetAdapterInfo tool.
Set folder permissions for UWP apps:
Not all folders on your device are accessible by Universal Windows Apps. To make a folder accessible to a UWP app, you can use FolderPermissions tool. For example, run FolderPermissions c:\test -e to give UWP apps access to c:\test folder. Note this will work only with native Win32 apis for eg. CreateFile2 and not with WinRT apis like StorageFolder, StorageFile etc.
Work with Serial Ports:
MinComm allows you to work with serial ports from the command line. It is provided as a sample project in the ms-iot samples repo.
Command-Line Reference
Applies To: Windows Server 2003, Windows Vista, Windows XP, Windows Server 2008, Windows 7, Windows Server 2003 R2, Windows Server 2008 R2, Windows Server 2000, Windows Server 2012, Windows 8
Use this topic to find the documentation resources and other technical information that you need to learn about the command shell, and to automate command-line tasks by using scripts or scripting tools.
To read introductory information about the command shell and command-line tools, see Feature description. To see a listing of new and deprecated command-line tools see New and deprecated functionality.
To find information about a specific command, in the following A-Z menu, click the letter that the command starts with, and then click the command name.
Prerequisites
The information that is contained in this overview applies to:
Windows Server 2012
WindowsВ ServerВ 2008В R2
WindowsВ ServerВ 2008
WindowsВ ServerВ 2003В R2
WindowsВ ServerВ 2003
Feature description
New and deprecated functionality
New or Deprecated?
Create a new cluster or configure an existing cluster.
Configure DFS folders and folder targets in a DFS namespace.
Creates and manages File Server Resource Manager quotas.
Create and manage file groups, file screens, file screen exceptions, and file screen templates that are used to configure general administrative options for screening files.
Enable optional features in Windows by downloading required files from WindowsВ Update or a source that Group Policy specifies.
Read, write, run, debug, and test Windows PowerShell scripts and modules in a friendly, graphic-assisted environment.
Install or remove roles, role services, and features.
Monitor an RD Session Host session.
Create and manage storage reports and storage report tasks, and configure general administrative options for File Server Resource Manager.
Command shell overview
The command shell is a software program that provides direct communication between the user and the operating system. The non-graphical, command shell user interface provides the environment in which you run character-based applications and utilities. The command shell executes programs and displays their output on the screen by using individual characters similar to the MS-DOS command interpreter, Command.com. The command shell in the Windows Server operating system uses the command interpreter, Cmd.exe. Cmd.exe loads applications, directs the flow of information between applications, and translates user input into a form that the operating system understands.
You can use the command shell to create and edit scripts to automate routine tasks. For example, you can create simple scripts in batch (.bat) files to automate the management of user accounts or nightly backups. You can also use the command-line version of Windows Script Host to run more sophisticated scripts in the command shell. For more information, see Cscript or Wscript. You can perform operations more efficiently by using scripts than you can by using the user interface. Scripts accept all commands that are available at the command line.
Customize the Command Prompt window
You can change the properties for the Command Prompt window.
To configure the Command Prompt window
Open a Command Prompt window, click the upper-left corner of the Command Prompt window, and then click Properties. (Or to open Command Prompt Properties from the keyboard, press ALT+SPACEBAR+P.)
Click the Options tab.
In Command History, type or select 999 in Buffer Size, and then type or select 5 in Number of Buffers. By increasing the screen buffer size to 999, you enable scrolling through the Command Prompt window. By increasing the number of buffers to five, you increase the number of lines in the Command Prompt window to 5000.
In Edit Options, select the Quick Edit Mode and Insert Mode check boxes.
Click the Layout tab.
In Screen Buffer Size, type or select 2500 in Height.
To further customize your Command Prompt window settings, perform any of the following optional tasks:
In Screen Buffer Size, increase Width.
In Window Size, increase Height.
In Window Size, increase Width.
Clear the Let system position window check box, and then, in Window Position, change the values in Left and Top.
In the Apply Properties dialog box, click Save properties for future windows with same title.
To enable or disable file and directory name completion on a computer or user logon session, run Regedit.exe and set the following REG_DWORD value : HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar\REG_DWORD To set the REG_DWORD value, use the hexadecimal value of a control character for a particular function (for example, 0Г—9 is Tab and 0Г—08 is Backspace). User-specified settings take precedence over computer settings, and command-line options take precedence over registry settings.
Incorrectly editing the registry may severely damage your system. Before making changes to the registry, you should back up any valued data on the computer.
Command-line reference A-Z
To find information about a specific command, in the following A-Z menu, click the letter that the command starts with, and then click the command name.
Each command-line tool topic displays the version of Windows that is supported by the command-line tool.