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.
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
- Acquires the BGInfo executable, configuration and wallpaper from the available sources.
- 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
-SkipOnlineUpdateCheckis used. - Deploys the existing
.bgiconfiguration without generating or modifying it. - Ensures the wallpaper referenced by the configuration is available. If it is missing, the script logs a warning rather than stopping the deployment.
- Removes the legacy
BgInforegistry Run value, if present, to avoid starting BGInfo twice. - Creates or refreshes an all-users Startup shortcut so BGInfo runs at interactive logon.
- Runs BGInfo immediately for the current session.
Default paths
| Item | Default location |
|---|---|
| BGInfo executable | C:\SysAdmin\Tools\SysinternalsSuite\Bginfo64.exe |
| Configuration file | C:\ProgramData\BGInfo\BGInfoStandard.bgi |
| Wallpaper image | C:\SysAdmin\Images\WindowsServer2028.jpg |
| Startup shortcut | C:\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:
| File | First choice | Second choice | Third choice |
|---|---|---|---|
Bginfo64.exe / Bginfo.exe | -SourcePath file share | Sysinternals BGInfo ZIP download | GitHub repository |
BGInfoStandard.bgi | -SourcePath file share | Existing local copy | GitHub repository |
WindowsServer2028.jpg | -SourcePath file share | Existing local copy / -WallpaperUrl | GitHub repository |
| Startup shortcut | Always 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
| Parameter | Default | Purpose |
|---|---|---|
-SourcePath | None | Share or folder containing deployment files; supplied files take priority. |
-BgInfoExe | C:\SysAdmin\Tools\SysinternalsSuite\Bginfo64.exe | Local executable path. |
-BgInfoConfig | C:\ProgramData\BGInfo\BGInfoStandard.bgi | Configuration used by the shortcut and immediate run. |
-StartupShortcut | All-users Startup folder | Path for the generated shortcut. |
-WallpaperPath | C:\SysAdmin\Images\WindowsServer2028.jpg | Local wallpaper path; it must match the path stored in the .bgi. |
-WallpaperUrl | None | Explicit online wallpaper source, overriding the repository for this file. |
-OnlineSourceUrl | GitHub repository raw URL on main | Online fallback base URL; set to an empty string to disable online fallbacks. |
-BgInfoDownloadUrl | Sysinternals BGInfo ZIP | Primary download source for the executable. |
-UpdateBgInfo | Off | Re-download the executable even if present, unless supplied by the share. |
-SkipOnlineUpdateCheck | Off | Skip the per-run online SHA-256 comparison. |
-RegisterMonthlyTask | Off | Register 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.