Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Sysinternals]
"EulaAccepted"=dword:00000001
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"BgInfo"="C:\\path\\Bginfo.exe /timer:0"
Thanks for the detailed guide!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"
#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