Skip to content

Instantly share code, notes, and snippets.

@danjpadgett
Created Mar 4, 2016
Embed
What would you like to do?
Set-ExecutionPolicy Bypass -Force
Function Set-WallPaper
{
if ((Test-Path "C:\Windows\Media\Wallpaper.jpg") -eq $false)
{
Copy-Item -Path ("\\server\Themes\BrandingOfficial\Desktop Wallpaper 2560x1440px 1 - v1.0.jpg") -Destination C:\windows\media\Wallpaper.jpg -Force
Write-Host "Wallpaper Copied"
}
{}
Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name Wallpaper -value "C:\Windows\Media\Wallpaper.jpg"
Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name TileWallpaper -value "0"
Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name WallpaperStyle -value "2"
}
$bginfo = Set-Location \\server\dfs\apps\bginfo\
$res = Get-WmiObject -Class Win32_VideoController | Select-Object CurrentHorizontalResolution
if ($res.CurrentHorizontalResolution -le '1680')
{
Write-Host "bginfo will apply"
$args = @('/TIMER:00', '/SILENT', '/NOLICPROMPT')
& "$bginfo.\bginfo.exe" "$bginfo.\Bginfo.bgi" $args
}
else
{
Write-Host "Processed Local wallpaper"
Set-WallPaper
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment