Docs / Automate / Post-Setup

Post-Setup

Automate execution of apps and scripts after installation.

Add files and directories to the image, and run tasks once at the end of Windows setup - or directly on the deployed installation when editing a live install.

Use the Add drop-down in the toolbar to add files, directories, commands, or one of the ready-made templates. Files can also be dragged and dropped onto the page. The entry type is detected from the file extension and shown in the Type column: installers, batch files, scripts (PowerShell, VBS), Registry files, Windows updates (MSU/CAB), images for the desktop background, or plain files to copy.

Before Logon vs After Logon

The page has two execution queues, shown as the Before logon (Machine) and After logon (User) sections:

  • Before logon (Machine) entries run during setup, before the first user logon. They always run elevated, and since no one is logged on, every task must be fully automated - an installer waiting for input will hang the setup at the Finalizing screen. The exact point is picked by the mode below.
  • After logon (User) entries run on the first user logon. They run elevated if the logged-on user is an administrator.

It is recommended to use the After logon queue unless a task specifically needs to run before user creation. Within each queue, entries execute top to bottom - reorder them with the Move up / Move down toolbar buttons.

Before Logon Mode

The Before logon - Mode selector in the toolbar decides when the Before logon queue is executed. The script itself is the same in every mode, only the trigger changes, so exactly one mode runs:

  • Post-OOBE (default) - runs when Windows setup completes, after the OOBE questions and right before the logon screen.
  • Pre-OOBE - runs before the OOBE questions appear. No user account exists yet, so commands must not rely on one. Needs Windows 10 version 1809 or newer, the entry is hidden on older images.
  • Unattended - runs through the unattended answer file, requires the Unattended page to be enabled. No visible progress.
  • SetupComplete.cmd - runs via the native Windows SetupComplete.cmd hook. Does not work with embedded or entered OEM keys.

No mode shows progress on Windows 11, the setup screens cover the console. Use only with fully automated tasks, as any prompt will hang the setup.

Windows skips SetupComplete.cmd on client editions installed with an OEM product key, so tasks queued in that mode would not run there. Server, retail and volume-licensed installations are unaffected. NTLite warns about this when the mode is selected.

Entry Types

Each file row has a type selector deciding what happens with it during deployment:

  • RunCopy and run the file, then delete it from its temporary location once all tasks are done.
  • CopyCopy only, no execution. The file is placed at a permanent, editable destination on the image.
  • CommandA command-line instruction, no file attached.
  • BackgroundPremiumCopy an image file and set it as the default desktop background (fit adjustable later via Windows Settings → Choose a fit).

Installers and Scripts

Executables, batch files, and scripts are copied and executed during deployment, then deleted from the temporary location. Make sure every installer has its correct silent switches set in the Parameters column - each row's parameters are edited directly in the grid. The Parameter Info toolbar button tries the help switch on the selected installer to list its available parameters.

An installer without silent switches in the Before logon queue will hang the installation at the login screen.

Registry (.REG) Files

REG files are copied and applied at the end of setup. While at first this seems the same as Integrate → Registry, the difference is that real integration writes directly into the image registry hives, while this one is delayed-applied at the end of Windows setup. This is useful for keys that are either reset during setup, break setup, or fail direct integration due to key permissions.

Windows Updates

MSU and CAB update packages added here are installed post-setup with the appropriate Windows tooling, useful for updates that resist offline integration.

Copied Files and Directories

Copy-type files and added directories are not executed - they are placed on the image for later use. Directories are added to the Before logon queue and copied with their content.

Destination

Copy-only and Background entries have an editable Destination column setting where the file lands on the deployed system, defaulting to the Windows\Setup directory. Run-type entries show Temporary instead - they are staged, executed, and cleaned up automatically.

Image vs ISO Storage

The Mode column selects where files are stored while traveling inside the image - the final destination on the deployed system is the same:

  • Image - files are stored within the install image, increasing the total WIM/ESD file size. Makes FAT32 media less feasible, but useful in scenarios where only a WIM file is used for deployment.
  • ISO - files are stored on the ISO using the $OEM$ directories, outside of the install image. Recommended when deploying from an ISO/USB, and the default for images loaded from one.

Using Copied Files in Commands

A copied file can be referenced by a later Command entry in the queue - for example, copy a configuration file, then run a command that consumes it. Select the copied row and its Parameters box shows the ready-to-use path syntax as read-only text, ready for copying into your command. Run-type files are staged under %WINDIR%\Setup\Files (Before logon) or C:\Windows\Setup\FilesU (After logon) until the queue finishes.

Templates

The Add drop-down includes ready-made entries for common tasks:

  • Disable hibernateTurns hibernation off post-install.
  • Disable user password expiration
  • Import host Start Menu layoutCopies the current machine's Start Menu layout into the default user profile (available when host and image Windows versions are compatible).
  • Install VMware ToolsPremiumDetects the host VMware installation.
  • CompactOS compression commands and an Edge WebView2 update entry.

Live Installations

When editing the currently running or another deployed installation, the same queue executes directly after pressing Process on the Apply page - no reinstall needed. The storage mode column is hidden since files go straight to their destination.