This page describes the command line arguments supported by the Answer File Generator, which are used to customize the generated answer file. All argument names are case insensitive.
Argument values can be specified as either e.g. -JoinDomain mydomain, -JoinDomain:mydomain or
-JoinDomain=mydomain.
Some arguments can be specified multiple times. This can be done by listing several values after the argument:
-LocalAccount "John,Password" "Dave,OtherPassword" -EnableRemoteDesktop
Or, by repeating the argument multiple times, potentially interleaving other arguments:
-LocalAccount "John,Password" -EnableRemoteDesktop -LocalAccount "Dave,OtherPassword"
This syntax makes Answer File Generator compatible with PowerShell hash table splatting, which can be a convenient way to handle invocations with many arguments.
$arguments = @{
"OutputPath" = "unattend.xml"
"InstallMethod" = "CleanEfi"
"Feature" = "Microsoft-Windows-Subsystem-Linux","VirtualMachinePlatform"
"WindowsVersion" = "10.0.22621.1"
"EnableRemoteDesktop" = $true
}
./GenerateAnswerFile @argumentsYou can also use JSON files to specify options for generating an answer file. In this
case, only the -OutputFile argument can be used.
The arguments are split into several categories:
GenerateAnswerFile
[[-OutputFile] <Path>]
[-AdministratorPassword <String>]
[-AutoLogonCount <Number>]
[-AutoLogonPassword <String>]
[-AutoLogonUser <[Domain\]User>]
[-ComputerName <String>]
[-DisableCloud]
[-DisableDefender]
[-DisableServerManager]
[-DisplayResolution <Resolution>]
[-DomainAccount <[Group:][Domain\]User>...]
[-EnableRemoteDesktop]
[-Feature <String>...]
[-FirstLogonCommand <String>...]
[-FirstLogonScript <String>...]
[-Help]
[-ImageIndex <Number>]
[-Install <InstallMethod>]
[-InstallToDisk <Number>]
[-InstallToPartition <Number>]
[-JoinDomain <String>]
[-JoinDomainOffline]
[-JoinDomainPassword <String>]
[-JoinDomainProvisioningFile <Path>]
[-JoinDomainUser <[Domain\]User>]
[-Language <String>]
[-LocalAccount <[Group:]Name,Password>...]
[-OnlineHelp]
[-OUPath <String>]
[-Partition <Label:Size>...]
[-ProcessorArchitecture <String>]
[-ProductKey <String>]
[-TimeZone <String>]
[-Version]
[-WindowsVersion <Version>]
The path and file name to write the answer file to. If not specified, the generated answer file is written to the console.
Value: <Path>
Alias: -o
Positional: TrueDisplays a help message.
Value: [<Boolean>]
Aliases: -?, -hShows additional help in your web browser, including example usage.
Value: [<Boolean>]
Aliases: -oh, -??Displays version information.
Value: [<Boolean>]The name of an optional feature to install. Use the PowerShell Get-WindowsOptionalFeature command
to get a list of valid feature names. Can have multiple values.
Must not be blank.
See optional features.
Value: <String> (multiple allowed)
Alias: -c
Required argument: -WindowsVersion
Allowed -Install values: ExistingPartition, CleanBios, CleanEfi, ManualThe index of the image in the WIM file to install. Use this for Windows editions not installed using
a product key, such as those that use volume licensing. Use the PowerShell Get-WindowsImage
command to list all images in a .wim or .esd file.
See selecting the edition to install.
Value: <Number>
Alias: -wim
Allowed -Install values: ExistingPartition, CleanEfi, CleanBiosThe installation method to use.
See installation method.
Value: PreInstalled, ExistingPartition, CleanEfi, CleanBios, Manual
Alias: -i
Default value: PreInstalledThe zero-based ID of the disk to install to. This disk will be wiped and repartitioned according to
-Partition, or using the default layout if -Partition is not
specified.
Must be at least 0.
Value: <Number>
Alias: -disk
Default value: 0
Allowed -Install values: ExistingPartition, CleanEfi, CleanBiosThe one-based ID of the partition to install to, on the disk specified by
-InstallToDisk. If not specified and -Install is CleanEfi or
CleanBios, Windows will be installed on the first regular data partition. If
-Install is ExistingPartition, the default value is 3, which is appropriate for
UEFI systems with the default partition layout.
Must be at least 1.
Value: <Number>
Alias: -part
Allowed -Install values: CleanEfi, CleanBios, ExistingPartitionA partition to create on the disk specified by -InstallToDisk. Can have
multiple values.
Use the format label:size or label:size[fs], where label is the volume label, size is the size
of the partition, and fs is an optional file system like FAT32 or NTFS. Sizes can use multiple-byte
units such as GB, and will be truncated to whole megabytes. For example System:100MB,
Windows:128GB, or Data:16GB[FAT32].
Use * as the size to extend the partition to fill the remainder of the disk (e.g. Windows:*).
Use the following labels to create special partitions: System, MSR, WinRE, and Recovery.
If not specified, the default partition layout for the method specified by -Install
is used.
Value: <Label:Size> (multiple allowed)
Alias: -p
Allowed -Install values: CleanEfi, CleanBiosThe product key used to select what edition to install, and to activate Windows.
Must not be blank.
See selecting the edition to install.
Value: <String>
Alias: -keyThe exact version and build number (e.g. 10.0.22621.1) of the OS being installed. This argument is
only used when -Feature is specified.
Value: <Version>
Alias: -vThe password to use for the built-in local Administrator account. If not specified, the Administrator account will be disabled by default.
Value: <String>
Alias: -apThe number of times the user specified by -AutoLogonUser will be automatically
logged on.
Must be at least 1.
Value: <Number>
Alias: -alc
Default value: 1
Required argument: -AutoLogonUserThe password of the user specified by -AutoLogonUser.
Must not be blank.
Value: <String>
Alias: -alp
Required argument: -AutoLogonUserThe name of a user to automatically log on, in the format domain\user, or just user for local
users. If not specified, automatic log-on will not be used.
Must not be blank.
See joining a domain and automatic logon.
Value: <[Domain\]User>
Alias: -alu
Required argument: -AutoLogonPasswordA local account to create, using the format group:name,password or name,password. Can have
multiple values. If no group is specified, the user will be added to the Administrators group. You
can specify multiple groups by separating them with semicolons.
If no local accounts are created, the user will be asked to create one during OOBE, making setup not fully unattended.
See creating a user during installation.
Value: <[Group:]Name,Password> (multiple allowed)
Alias: -aThe name of a domain account to add to a local group, using the format group:domain\user,
domain\user, group:user or user. If no group is specified, the user is added to the local
Administrators group. You can specify multiple groups by separating them with semicolons. If no
domain is specified, the user must be in the domain you're joining. Can have multiple values.
Must not be blank.
Value: <[Group:][Domain\]User> (multiple allowed)
Alias: -da
Requires one of: -JoinDomain, -JoinDomainProvisioningFileThe name of a domain to join. If not specified, the system will not be joined to a domain.
Must not be blank.
See joining a domain and automatic logon.
Value: <String>
Alias: -jd
Required arguments: -JoinDomainUser, -JoinDomainPasswordJoin the domain during the offlineServicing pass of Windows setup, rather than the specialize pass.
Value: [<Boolean>]
Alias: -jdo
Required argument: -JoinDomainProvisioningFile
Allowed -Install values: ExistingPartition, CleanBios, CleanEfi, ManualThe password of the user specified by -JoinDomainUser. This will be stored in
plain text in the answer file.
Must not be blank.
Value: <String>
Alias: -jdp
Required argument: -JoinDomainThe path to a file containing provisioned account data to join the domain. This file can be created
using the command djoin.exe /provision /domain domainname /machine machinename /savefile filename.
See joining a domain using provisioning.
Value: <Path>
Alias: -jdpf
Prohibited argument: -JoinDomainThe name of a user with permission to join the domain specified by -JoinDomain.
Use the format domain\user, or just user if the user is a member of the domain you are joining.
Must not be blank.
Value: <[Domain\]User>
Alias: -jdu
Required argument: -JoinDomainThe organizational unit to use when joining the domain specified by -JoinDomain.
Must not be blank.
Value: <String>
Alias: -ou
Required argument: -JoinDomainThe network name for the computer. If not specified, Windows will generate a default name. Any #
characters in the name will be replaced with a random digit between 0 and 9. For example, PC-###
would be replaced with PC-123 (or some other random number).
Must not be blank.
See specifying a computer name.
Value: <String>
Alias: -nDisable Windows cloud consumer features. This prevents auto-installation of recommended store apps.
Value: [<Boolean>]
Alias: -dcDisable Windows Defender virus and threat protection.
Value: [<Boolean>]
Alias: -dDo not automatically start Server Manager when logging on (Windows Server only).
Value: [<Boolean>]
Alias: -dsmThe display resolution, in the format width,height. For example, 1920,1080. If not specified,
the default resolution is determined by Windows.
Value: <Resolution>
Alias: -resTurn on remote desktop, and create a Windows Defender Firewall rule to allow incoming connections.
Value: [<Boolean>]
Alias: -rdpA command to run during first logon. Can have multiple values. All commands are executed before the
scripts specified by -FirstLogonScript, in the order specified.
Must not be blank.
See first log-on commands and scripts.
Value: <String> (multiple allowed)
Alias: -cmdThe full path of a Windows PowerShell script to run during first log-on, plus arguments. Can have
multiple values. Scripts are executed after the commands specified by
-FirstLogonCommand, in the order specified.
Must not be blank.
See first log-on commands and scripts.
Value: <String> (multiple allowed)
Alias: -sThe language used for the UI language, and the input, system and user locales.
Must not be blank.
Value: <String>
Alias: -lang
Default value: en-USThe processor architecture of the Windows edition you're installing. Use amd64 for 64 bit Intel
and AMD processors, x86 for 32 bit, and arm64 for ARM-based devices.
Must not be blank.
Value: <String>
Alias: -arch
Default value: amd64The time zone that Windows will use. Run tzutil /l for a list of valid values.
Must not be blank.
Value: <String>
Default value: Pacific Standard Time