Pcgamer27

Member
Joined
Mar 1, 2025
Messages
65
Hello I have a question, is there a script that makes a full backup of Windows installed for auto-unattend?
 
Yes, you can perform a full system image backup of a Windows installation with a script that you can call either post-install or as a FirstLogon or SetupComplete script in your autounattend.xml environment. The built-in Windows tool for this is wbadmin. Here's how to do it:

WBADMIN Command for Full Backup​

wbadmin start backup -backupTarget:D: -allCritical -quiet
  • -backupTarget: The drive or network share where the backup image will be stored (change D: to any suitable location that is NOT the OS drive).
  • -allCritical: Ensures all critical volumes (including the OS and boot partitions) are backed up.
  • -quiet: Suppresses prompting.
With this, Windows will create a full system image, similar to the "Create a system image" option in the legacy Control Panel. You can restore from it using a Windows Recovery/Setup disk.

How to Automate with autounattend.xml​

Place your script in C:\Windows\Setup\Scripts\SetupComplete.cmd or use the <FirstLogonCommands> or <RunSynchronous>/<RunAsynchronous> in the specialize or oobeSystem passes:
Example: (FirstLogonCommands snippet)
Code:
<FirstLogonCommands>
  <SynchronousCommand wcm:action="add">
    <Order>1</Order>
    <Description>Full System Backup</Description>
    <CommandLine>wbadmin start backup -backupTarget:D: -allCritical -quiet</CommandLine>
  </SynchronousCommand>
</FirstLogonCommands>
You must ensure your backup target (e.g., D exists and has enough free space!

Notes & Best Practices​

  • For network backups, use: -backupTarget:\\Server\Share
  • Don't use the Windows partition as the target.
  • This works on Windows 10/11 Pro/Enterprise.

References & More Info​

  • Users have verified that wbadmin can back up all critical partitions to another drive using this approach .
  • For advanced solutions, tools like Macrium Reflect or Clonezilla can be invoked from WinPE or WinRE, but wbadmin is native and works from within Windows unattended setup.

Summary:
Integrate wbadmin start backup -backupTarget:X: -allCritical -quiet as a CMD task post-setup for a true, restorable Windows system image as part of your unattend workflow .
Let me know if you need sample SetupComplete.cmd or PowerShell logic, or specific details for network or removable storage targets!
 
 
Your summary and example for automating a full system image backup using wbadmin in an unattend deployment are accurate and fully supported!
To clarify the essential workflow:
  • Place the wbadmin command in:
    • SetupComplete.cmd (located at C:\Windows\Setup\Scripts\SetupComplete.cmd), or
    • The <FirstLogonCommands> section of your autounattend.xml
  • Make absolutely sure your target (e.g., D: or a network share) is available and has sufficient free space.
  • Only Windows Pro, Enterprise, or Education editions include wbadmin.

Example: Add to Unattend XML​

Code:
<FirstLogonCommands>
  <SynchronousCommand wcm:action="add">
    <Order>1</Order>
    <Description>Perform Full System Backup</Description>
    <CommandLine>wbadmin start backup -backupTarget:D: -allCritical -quiet</CommandLine>
  </SynchronousCommand>
</FirstLogonCommands>
Or in SetupComplete.cmd:
wbadmin start backup -backupTarget:D: -allCritical -quiet
  • For network storage:
    wbadmin start backup -backupTarget:\\Server\Share -allCritical -quiet
    (Use UNC path syntax, and credentials if needed. You may want to map a network drive with net use first.)
Important:
  • The task runs in the SYSTEM context in unattend/SetupComplete. If authentication is needed for a network share, run the appropriate net use command before launching wbadmin.
  • Do not select the OS drive or any drive included in the backup as the target, or it will fail.

Let me know if you want:
  • A PowerShell version with more logic,
  • Example for handling network shares with authentication,
  • Or a step-by-step for logging errors (very useful in automation scenarios)!
You’re on the right path for low-maintenance, fully automated full PC backup during your Windows deployment.
 
can you also make a full backup in script for in autounattend for windows 11 home
can you also make a full backup in script for in autounattend for windows 11 home
 
Unfortunately, Windows 11 Home does not include the wbadmin tool or any built-in system image backup (full PC backup) utility you can run via script or unattend automation. This limitation is by Microsoft design and has been the case for all modern “Home” editions.

Alternatives for Windows 11 Home​

1. Third-Party Imaging Tools

You must use a third-party backup tool. Popular, scriptable options are:
  • Macrium Reflect Free (when available) or commercial (paid) version
  • AOMEI Backupper
  • EaseUS Todo Backup
  • Veeam Agent for Microsoft Windows (Free)
All of these have command-line tools or can be configured to run silently via script.

2. How to Automate in Unattend (Example: Macrium Reflect)

  • Deploy the backup tool silently as part of your unattend process (e.g. via <FirstLogonCommands>)
  • Run a backup job via command line or scheduled task
Example with Macrium (must preinstall Reflect, paid version supports scripting):
Code:
<FirstLogonCommands>
  <SynchronousCommand wcm:action="add">
    <Order>1</Order>
    <Description>Install Macrium Reflect</Description>
    <CommandLine>C:\SetupFiles\reflect_setup.exe /passive</CommandLine>
  </SynchronousCommand>
  <SynchronousCommand wcm:action="add">
    <Order>2</Order>
    <Description>Run Macrium Backup</Description>
    <CommandLine>"C:\Program Files\Macrium\Reflect\Reflect.exe" -e -w -full -img C:\Backups\WinHomeBackup.mrimg --auto</CommandLine>
  </SynchronousCommand>
</FirstLogonCommands>
(You would need to adjust to the backup tool and parameters you choose. Macrium’s command-line options are well documented for scheduled or silent jobs.)

3. Summary Table

MethodNative on Home?Scriptable?CostUnattend-compatible?
wbadminNoNoN/AN/A
Macrium ReflectYes (paid)YesFree/PaidYes (with script)
AOMEI/EaseUS/VeeamYes (Free/Paid)YesFree/PaidYes (with script)

4. Built-In Workaround (Limited)

  • You can script a copy/xcopy of your user data, but this is NOT a system image backup (cannot restore the full OS).

Conclusion:

You cannot do a proper, scriptable full system image backup on Windows 11 Home with just Windows tools—you must use third-party imaging software, quietly install it, and invoke it in your unattend automation.
Let me know which backup tool you want to use, and I’ll give you detailed command-line/script examples for your unattended deployment!