Skip to content

Instantly share code, notes, and snippets.

@danjpadgett
Created March 4, 2016 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danjpadgett/908cc1b83696ee403ce9 to your computer and use it in GitHub Desktop.
Save danjpadgett/908cc1b83696ee403ce9 to your computer and use it in GitHub Desktop.
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