Automated install of BgInfo

Sephir8th

New Member
Is there a way to automate the installation of bginfo assuming one already has it configured right into the iso?
 
There's no scripting required to install Sysinternals tools, since they're all portable files and don't have an assigned path.

Create an $OEM$ folder under the ISO's \sources directory, and Windows will copy whatever's inside to the target system.

sources\$OEM$\$$\Folder -> C:\Windows\Folder
sources\$OEM$\$1\Folder -> C:\Folder
sources\$OEM$\$2\Folder -> D:\Folder

Integrate this reg file (in Registry), so you can skip accepting the EULA for every Sysinternal tool:
Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Sysinternals]
"EulaAccepted"=dword:00000001

This runs BgInfo every time you log on (double backslashes for the path):
Code:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"BgInfo"="C:\\path\\Bginfo.exe /timer:0"
 
I forgot winget does Sysinternals now, but don't recommend it. Then it's an all-or-nothing software suite, and you can't keep separate versions of the files around for older compatibility.
 
There's no scripting required to install Sysinternals tools, since they're all portable files and don't have an assigned path.

Create an $OEM$ folder under the ISO's \sources directory, and Windows will copy whatever's inside to the target system.

sources\$OEM$\$$\Folder -> C:\Windows\Folder
sources\$OEM$\$1\Folder -> C:\Folder
sources\$OEM$\$2\Folder -> D:\Folder

Integrate this reg file (in Registry), so you can skip accepting the EULA for every Sysinternal tool:
Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Sysinternals]
"EulaAccepted"=dword:00000001

This runs BgInfo every time you log on (double backslashes for the path):
Code:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"BgInfo"="C:\\path\\Bginfo.exe /timer:0"
Thanks for the detailed guide!
 
Last edited:
For anyone who runs into the same issue as I did installing a stripped down Windows 10 and bginfo didn't work because snmpapi.dll isn't installed. I used PowerBGInfo to do the same thing in Powershell. All I needed was machine name and IP, but you can add more variables in your output if you need more info on your wallpaper.

PowerBGInfo GitHub is here for more documentation: https://github.com/EvotecIT/PowerBGInfo

Code:
#Variables for staging
$hostname = hostname
$ipaddress = (Get-NetIPAddress -AddressFamily IPv4 -AddressState Preferred -PrefixOrigin Dhcp | Select -exp IPAddress)
$resolution = (Get-WmiObject -Class Win32_DesktopMonitor | Select -exp ScreenWidth)
$folder = 'C:\bginfo\Output'
$file = 'C:\bginfo\bginfo.jpeg'
#Check if PackageProvider is installed
if (Get-PackageProvider -ListAvailable -Name NuGet) {
    Write-Host "NuGet Installed"
}
else {
    Install-PackageProvider -Name NuGet -Force
}
#Check if PowerBGInfo module is installed
if (Get-Module -ListAvailable -Name PowerBGInfo) {
    Write-Host "BGInfo Module Installed"
}
else {
    Install-Module PowerBGInfo -Force
}
#Check if bginfo folder exists and create it if it doesn't
if (Test-Path -Path $Folder) {
    "Path exists!"
} else {
   New-Item -Path 'C:\bginfo\Output' -ItemType Directory
}
#Check if black background template file exists and download it if it doesn't
if (-not(Test-Path -Path $file -PathType Leaf)) {
    Invoke-WebRequest -Uri "URL to some solid black background here" -OutFile $file
    Write-Host "BGinfo template downloaded"
     }
 else {
     Write-Host "[$file] already exists."
 }
 #Set variables for background to display and generate based on current screen resolution offset
New-BGInfo -MonitorIndex 0 {
    New-BGInfoValue -Name "Computer Name:" -Value $hostname -Color White -FontSize 50 -FontFamilyName 'Calibri'
    New-BGInfoValue -Name "IP Address:" -Value $ipaddress -Color White -FontSize 50 -FontFamilyName 'Calibri'
    } -FilePath C:\bginfo\bginfo.jpeg -ConfigurationDirectory C:\bginfo\Output -PositionX (1100 - $resolution) -PositionY 100 -WallpaperFit Fill
 
Back
Top