IoT Core Add-ons command-line options

These tools are part of the Windows 10 IoT Core (IoT Core) ADK Add-Ons, in the \Tools folder. To learn more about these tools, see What's in the Windows ADK IoT Core Add-ons.

appx2pkg.cmd

Creates the folder structure and copies the template files for a new package.

BuildAgent.cmd

Builds FFUs for all OEMInputSamples under the Addon Kit directory. Can be used to automate nightly builds.

buildbsp.cmd

Builds BSP packages after signing all the required binaries.

Usage:

buildbsp {bspname/all} [version]
Parameters Description
BSPName Name of the build BSP directory.
All Builds all BSP directories.
Version Optional. Specifies package version. If not specified, it uses bsp_version.

Examples

buildbsp rpi2
buildbsp rpi2 10.0.1.0
buildbsp all
buildbsp all 10.0.2.0

buildfm.cmd

Builds feature merger files.

Usage:

buildfm {oem/bsp/all} [bspname] [version]
Parameters Description
OEM Builds OEMFM/OEMCommonFM files
BSP Builds BSP files
All Builds both OEM and BSP files
BSPName Required for BSP. Name of the BSP. Not required with OEM or All
Version Optional. Specifies package version. If not specified, it uses version defined in the variable %BSP_VERSION%.

Examples

buildfm oem
buildfm bsp Rpi2
buildfm all

buildimage.cmd

Builds an image file (FFU), using the product-specific packages. Uses createimage.cmd, includes additional options.

Usage:

buildimage [ProductName]/[All]/[Clean] [BuildType] [Version]
Parameters Description
ProductName Required, Name of the product to be built.
All All Products under the \Products directory are built.
Clean Cleans the output directory. One of the above should be specified.
BuildType Optional, Retail/Test, if not specified both types are built.
Version Optional, Package version. If not specified, it uses version defined in the variable %BSP_VERSION%
/? Displays this usage string.

Examples:

buildimage SampleA Test
buildimage SampleA Retail
buildimage SampleA
buildimage All Test
buildimage All
buildimage Clean

buildpkg.cmd

Builds a package from \Sources-<arch>\Packages.

Buildpkg saves the package in the \Build\<arch>\pkgs folder as a .cab file (example: Contoso.Provisioning.Auto.cab).

For troubleshooting, Buildpkg saves logs at \Build\<arch>\pkgs\logs.

Usage:

buildpkg [CompName.SubCompName]/[packagefile.wm.xml]/[All]/[Clean] [version]
Parameters Description
CompName.SubCompName Use this to refer to the package by its ComponentName.SubComponent Name.
packagefile.wm.xml Use this to refer to the package by its package definition XML file.
All Builds all packages in the \Sources-<arch>\Packages folder. This is the same as the BuildPkg All command.
Clean Use this to erase everything in the \Build\<arch>\pkgs folder. Recommended before building all packages.
version Optional, used to specify a version number. If you don't specify one, the default is to use the version defined in the variable %BSP_VERSION%.

Examples:

buildpkg Appx.Main
buildpkg Appx.Main 10.0.1.0
buildpkg sample.wm.xml
buildpkg sample.wm.xml 10.0.1.0
buildpkg All
buildpkg All 10.0.2.0
buildpkg Clean

buildrecovery.cmd

Creates a recovery image by adding required wim files to the recovery partition. See Add a recovery mechanism to your image. This command also invokes newwinpe.cmd and buildimage.cmd if the winpe.wim and Flash.ffu files are not present.

Usage:

buildrecovery <ProductName> [BuildType] [WimMode] [WimDir]
Parameter Description
ProductName Required, Name of the product to be built.
BuildType Optional, Retail/Test, if not specified both types are built.
WimMode Optional, Import/Export, if import is specified, the wim files from WimDir are used, if export is specified, the extracted wim files are copied to WimDir.
WimDir Optional, directory to import or export wim files. Mandatory when WimMode is specified

Example:

buildrecovery RecoverySample Test

exportpkgs.cmd

Exports all the packages used in a product configuration to a directory.

Usage:

exportpkgs DestDir Product BuildType [OwnerType]
Parameters Description
DestDir Required. Destination directory to export.
Product Required. Name of the product.
Buildtype Required. Can be Retail or Test.
Owner Optional. Can be MS, OEM, or All. Default value is All.

Examples:

exportpkgs C:\Temp SampleA Test OEM
exportpkgs C:\Temp SampleA Retail ALL

flashsd.cmd

Flashes an image to a specified SD card. FlashSD.cmd requires you to specify a physical drive number. Connect your SD card to your PC, and then open diskmgr.msc to see the physical drive number of the SD card.

Usage:

flashsd product buildtype drivenr
Parameters Description
product Name of the product.
buildtype Retail or Test. Specifies the buildtype.
drivenr Physical drive number of the SD card.

Example:

flashSD SampleA test 2

GetAppXInfo.exe

Extracts appx package-related information for a given .appx or .appbundle package.

Usage:

GetAppxInfo.exe appxfile

Example:

GetAppXInfo.exe IOTCoreDefaultApp_1.1.0.0_ARM.appx

inf2cab.cmd

Converts a .inf driver package to a .cab file.

Inf2cab saves the package in the \Build\<arch>\pkgs folder (example: Drivers.GPIO.cab).

Usage

inf2cab filename.inf [CompName.SubCompName]
Parameters Description
filename.inf Required, input file for the driver.
CompName.SubCompName Optional, refers to the driver package by its ComponentName.SubComponent Name.

Examples:

inf2cab C:\test\gpiodriver.inf
inf2cab C:\test\gpiodriver.inf Drivers.GPIO

inf2pkg.cmd

Creates the folder structure and copies the template files for a new package

Usage:

inf2pkg input.inf [CompName.SubCompName] OwnerName
Parameters Description
input.inf Required, input .inf file
CompName.SubCompName Optional, default is Drivers.input
OwnerName Optional, default is $(OEMNAME)
/? Displays this usage string.

Example:

inf2pkg C:\test\testdriver.inf

IoTCoreShell.cmd

Opens the IoT Core Shell as an administrator. (This file is in the root folder, and uses LaunchTool.cmd)

After you open IoTCoreShell, you'll be prompted to choose a default architecture (ARM or x86) for the devices you'll be building. This sets your default starting set of system variables.

LaunchTool.cmd

Configures the command shell with required settings.

newappxpkg.cmd

Creates a new package folder to help you convert appx packages to .cab files. The provisioning package version (version field in customizations.xml) is set to the appx version itself.

This command creates the working folder in the \Source-<arch>\Packages\ folder.

If you run this command without any variables, you'll also see the other working folders in the \Source-<arch>\Packages\ folder.

Usage:

newappxpkg filename.appx [fga]/[bgt]/[none] [CompName.SubCompName] [skipcert]
Parameters Description
filename.appx Required, input file for the Appx package.
fga/bgt/none Required, chooses the app's behavior on startup. fga-App will be forground app. bgt-App will start in background. none-App will not run on startup.
CompName.SubCompName Optional, creates the working folder using the name: ComponentName.SubComponent.
skipcert Optional, specify this to skip adding cert information.

Example:

newappxpkg C:\test\MainAppx_1.0.0.0_arm.appx fga AppX.Main

To learn more, see Lab 1b: Add an app to your image.

newbsp.cmd

Creates the folder structure and copies the template files for creating a new board support package (BSP).

Usage:

newbsp BSPName
Parameter Description
BSPName Required, Name of the BSP to be used.

Example:

newbsp CustomRPi2

newcommonpkg.cmd

Creates a new working folder to help you add files, folders, registry keys, and provisioning packages as .cab files. After using this command, use the buildpkg command to create your final .cab file.

This command creates the working folder in the \Common\Packages\ folder.

If you run this command without any variables, you'll also see the other working folders in the \Common\Packages\ folder.

Usage:

newcommonpkg CompName.SubCompName
Parameter Description
CompName.SubCompName Required, creates the working folder using the name ComponentName.SubComponent.

Example:

newcommonpkg Registry.FilesAndRegKeys

To learn more, see Lab 1c: Add a file and a registry setting to an image.

newdrvpkg.cmd

Used to add a driver to an image. Creates a new working folder to help you convert driver packages to .cab files. After using this command, use the buildpkg command to create your final .cab file.

This command creates the working folder in the \Source-<arch>\Packages\ folder.

If you run this command without any variables, you'll also see the other working folders in the \Source-<arch>\Packages\ folder.

Usage:

newdrvpkg filename.inf [CompName.SubCompName]
Parameters Description
filename.inf Required, input .inf file for the driver package.
CompName.SubCompName Optional, creates the working folder using the name: ComponentName.SubComponent. The default is Drivers.<filename>.

Example:

newdrvpkg C:\test\GPIO.inf Drivers.GPIO

newproduct.cmd

Used to create new product configuration. Creates a new working product directory under \Products and copies the contents from the template file.

Usage:

newproduct <productname> bsp
Parameter Description
productname Name of the product to be created.
bsp Name of the BSP to be used.

Example:

newproduct ProductA rpi2

newwinpe.cmd

Creates a WinPE image for a specified bsp and a device layout (identified by the socname). See Add a recovery mechanism to your image.

Usage:

newwinpe <bspname> <socname>
Parameter Description
bspname Name of the bsp to be used.
socname Identifier for the device layout, specified in the bspfm.xml under devicelayout section.

Example:

newwinpe QCDB410C QC8016_R

retailsign.cmd

Toggles between using OEM cross-certificate and test certificates for signing

Usage:

retailsign {On/Off}
Parameters Description
On Enables Cross Cert for signing.
Off Disables Cross Cert for signing and enables OEM Test Signing.

Examples:

retailsign On
retailsign Off

setenv.cmd

Resets your environment variables, including IOTADK_ROOT, COMMON_DIR, SRC_DIR, BLD_DIR, PKGBLD_DIR, TOOLS_DIR, and more.

Open setenv.cmd in a text editor to see the full list of variables set.

Usage:

setenv {arm|x86|x64}
Parameter Description
arch Architecture to be set (arm, x86, or x64).

Example:

setenv.cmd arm

setOEM.cmd

Sets your OEM company name. Edit this file with a text editor.

Example:

set OEM_NAME=Fabrikam

Where Fabrikam is the OEM company name.Only alphanumeric characters are supported in the OEM_NAME as this is used as a prefix for various generated file names.

setsignature.cmd

Sets the Cross-Certificates for kernel-mode code signing

setversion.cmd

Sets the version numbers used when creating a package with createpkg.cmd or a provisioning package with createprovpkg.cmd.

This version information is stored in %PRJ_DIR%\versioninfo.txt and loaded back when the IoT Core Shell is launched again. Whenever the package contents are changed, the version has to be updated and all packages need to be recreated.

Usage:

setversion x.y.z.a
Parameters Description
x.y.z.a Four-part version number to be used for packages.

Example:

setversion 10.0.0.1

signbinaries.cmd

Signs different file types in a directory

Usage:

signbinaries {bsp/all/file extension} dir
Parameters Description
bsp Signs all .sys/.dll files.
all Signs all .dll, .sys, and .ppkg files.
file extension Signs all files of a specified type. For example, .cab, .dll, .sys,etc.
dir Directory with files to be signed.

Example:

signbinaries bsp %BSPSRC_DIR%
signbinaries all %BSPSRC_DIR%
signbinaries exe %BSPSRC_DIR%

IoT Core Add-ons

IoT Core manufacturing guides