Automating BGInfo Deployment on Windows

Automating BGInfo Deployment on Windows

Keeping important system information visible on Windows desktops can make administration and troubleshooting easier. Sysinternals BGInfo can display that information on the desktop wallpaper, but deploying and maintaining it across multiple machines can take time.

This project automates that process with a single PowerShell script. It deploys BGInfo, its configuration and wallpaper, creates an all-users Startup shortcut, and applies the wallpaper immediately. The script is designed to be re-run safely whenever you need to refresh a deployment.

Windows Server desktop with a blue Windows-themed wallpaper
A Windows Server desktop with the custom wallpaper.

Explore the BGInfo Deployment repository or view the deployment script on GitHub. This post is based on the project’s README.

What the script does

  1. Acquires the BGInfo executable, configuration and wallpaper from the available sources.
  2. By default, compares local files against online sources using SHA-256 and replaces files when their contents differ. Online checking is skipped when a source share is supplied or -SkipOnlineUpdateCheck is used.
  3. Deploys the existing .bgi configuration without generating or modifying it.
  4. Ensures the wallpaper referenced by the configuration is available. If it is missing, the script logs a warning rather than stopping the deployment.
  5. Removes the legacy BgInfo registry Run value, if present, to avoid starting BGInfo twice.
  6. Creates or refreshes an all-users Startup shortcut so BGInfo runs at interactive logon.
  7. Runs BGInfo immediately for the current session.

Default paths

ItemDefault location
BGInfo executableC:\SysAdmin\Tools\SysinternalsSuite\Bginfo64.exe
Configuration fileC:\ProgramData\BGInfo\BGInfoStandard.bgi
Wallpaper imageC:\SysAdmin\Images\WindowsServer2028.jpg
Startup shortcutC:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\Bginfo64.exe.lnk

The shortcut launches BGInfo with the configuration and silent options:

Bginfo64.exe "C:\ProgramData\BGInfo\BGInfoStandard.bgi" /timer:0 /nolicprompt /silent

Where deployment files come from

The script checks sources in priority order for each file:

FileFirst choiceSecond choiceThird choice
Bginfo64.exe / Bginfo.exe-SourcePath file shareSysinternals BGInfo ZIP downloadGitHub repository
BGInfoStandard.bgi-SourcePath file shareExisting local copyGitHub repository
WindowsServer2028.jpg-SourcePath file shareExisting local copy / -WallpaperUrlGitHub repository
Startup shortcutAlways generated from scratch; never copied or downloaded

A supplied file share takes priority, but a partially stocked share can still be used: missing files produce a warning and the script falls through to other sources. The default online source is the companion GitHub repository. Its raw URLs point to the latest commit on main.

Downloads are staged in a temporary file before being moved into place. If an online update check fails, the existing local file is retained.

Running the deployment

Open PowerShell as an administrator and run the script. Here are some common examples:

# Standard run: check online sources for updates
.\DeployAndConfigureBgInfo.ps1

# Deploy from an internal file share
.\DeployAndConfigureBgInfo.ps1 -SourcePath '\\fileserver\Deploy\BGInfo'

# Skip online update checks
.\DeployAndConfigureBgInfo.ps1 -SkipOnlineUpdateCheck

# Register optional monthly maintenance
.\DeployAndConfigureBgInfo.ps1 -RegisterMonthlyTask

# Force a fresh BGInfo executable download
.\DeployAndConfigureBgInfo.ps1 -UpdateBgInfo

# Specify a custom wallpaper source
.\DeployAndConfigureBgInfo.ps1 -WallpaperUrl 'https://intranet.contoso.com/branding/WindowsServer2028.jpg'

# Use a share on an air-gapped machine
.\DeployAndConfigureBgInfo.ps1 -SourcePath '\\fileserver\Deploy\BGInfo' -OnlineSourceUrl ''

Available parameters

ParameterDefaultPurpose
-SourcePathNoneShare or folder containing deployment files; supplied files take priority.
-BgInfoExeC:\SysAdmin\Tools\SysinternalsSuite\Bginfo64.exeLocal executable path.
-BgInfoConfigC:\ProgramData\BGInfo\BGInfoStandard.bgiConfiguration used by the shortcut and immediate run.
-StartupShortcutAll-users Startup folderPath for the generated shortcut.
-WallpaperPathC:\SysAdmin\Images\WindowsServer2028.jpgLocal wallpaper path; it must match the path stored in the .bgi.
-WallpaperUrlNoneExplicit online wallpaper source, overriding the repository for this file.
-OnlineSourceUrlGitHub repository raw URL on mainOnline fallback base URL; set to an empty string to disable online fallbacks.
-BgInfoDownloadUrlSysinternals BGInfo ZIPPrimary download source for the executable.
-UpdateBgInfoOffRe-download the executable even if present, unless supplied by the share.
-SkipOnlineUpdateCheckOffSkip the per-run online SHA-256 comparison.
-RegisterMonthlyTaskOffRegister or refresh the optional monthly maintenance task.

Optional monthly maintenance

Use -RegisterMonthlyTask to create or refresh the BGInfo Monthly Maintenance scheduled task. It runs on the first day of each month at 03:00 under SYSTEM with highest privileges, re-running the script with default settings and appending output to DeployAndConfigureBgInfo.log next to the script.

The task is strictly opt-in: normal runs do not create or modify it. To remove it, run:

schtasks /Delete /TN "BGInfo Monthly Maintenance" /F

Design decisions

Startup shortcut instead of a registry Run entry

The all-users Startup shortcut is visible and self-documenting. The script removes the legacy registry value to prevent duplicate launches, and regenerates the shortcut on each run so it uses the configured local paths.

Deploy the BGInfo configuration unchanged

The .bgi file is a proprietary binary format, so editing it programmatically risks corruption. Instead, edit it in the BGInfo GUI, save it, publish it to the share or GitHub repository, and re-run the deployment script on target machines.

Match the wallpaper path

The .bgi references the wallpaper by an absolute local path. If you change that path in the configuration, supply a matching -WallpaperPath when running the script.

Testing and error handling

The README describes tested scenarios including local deployments, online downloads, fallback when Sysinternals is unavailable, an internal file share, stale local files, and runs with online update checking disabled.

The script provides timestamped, color-coded logs, a configuration banner and a deployment summary. Fatal errors terminate with exit code 1 for management tools to detect. Non-fatal issues, such as a missing wallpaper or failed online update check, are logged as warnings.

Requirements

  • Windows with PowerShell 5.1 or later.
  • Administrator rights.
  • TLS 1.2 capability, enabled by the script when needed.
  • Internet access when required files are not available locally or from the supplied share.

For the latest source and full details, visit the BGInfo Deployment repository on GitHub.

Leave a Reply, get the discussion going, share and learn with your peers.

This site uses Akismet to reduce spam. Learn how your comment data is processed.