WBADMIN - CMD


Overview

WBADMIN is a command-line utility included in Windows operating systems that helps users manage backups, restores, and recovery of their files and systems. Primarily, it serves as a powerful tool for system administrators to automate and script backup operations, ensuring data integrity and swift recovery in case of data loss or system failure.

Syntax

The basic syntax for WBADMIN involves starting with the command followed by a specific subcommand, each tailored for different tasks:

wbadmin [start backup] [options]
wbadmin [get items] [options]
wbadmin [start recovery] [options]
wbadmin [delete backup] [options]

Required Parameters:

  • start backup: Initiates a backup process.
  • get items: Lists items contained in a backup.
  • start recovery: Begins recovery from a specified backup.
  • delete backup: Removes a backup set.

Optional Arguments:

These vary based on the subcommand used. However, some common options include:

  • -backuptarget: Specifies the storage location for the backup.
  • -include: Files or folders to include in the backup.
  • -allCritical: Backup all critical volumes.
  • -quiet: Runs the backup with no prompts to the user.

Options/Flags

  • -backuptarget: Defines where the backup is saved (e.g., E: or \\Server\Share).
  • -include: Lists files or directories to be backed up, separated by commas.
  • -allCritical: Ensures that all critical system components are backed up, typically used for system state or full system backups.
  • -quiet: Suppresses prompts during the execution, useful for automating operations through scripts.

Examples

Example 1: Basic Backup

Backup the C: drive to an external drive E:.

wbadmin start backup -backuptarget:E: -include:C: -quiet

Example 2: Full system backup

Backup all critical components and system state data to a network share.

wbadmin start backup -backuptarget:\\Server\Share -allCritical

Example 3: Recovery

Recover items from a backup stored on E: drive.

wbadmin start recovery -version:03/23/2021-05:00 -itemType:File -items:C:\Users\Document.txt -recursive -backuptarget:E:

Common Issues

Permission Errors:
Users may encounter permission-related errors when attempting backups or recoveries. Ensure that the command prompt is run as an administrator to avoid such issues.

Network Accessibility:
When using network locations for backups or recovery, ensure the network path is accessible and credentials (if required) are correctly specified.

Integration

WBADMIN can be utilized alongside other CMD commands or batch scripts to create comprehensive backup solutions. For instance, combining with schtasks for scheduling:

schtasks /create /tn "WeeklyBackup" /tr "wbadmin start backup -backuptarget:F: -include:C: -quiet" /sc weekly /st 22:00
  • Task Scheduler (schtasks): Automate backups by scheduling WBADMIN to run at specific times.
  • Robocopy: Use in conjunction with WBADMIN for more granular file copy options pre or post backup operations.

For additional resources and official documentation, refer to the Microsoft Docs page for WBADMIN.