Need some help!!
IAMinZoho opened this issue · comments
First of all, applauds for the excellent work!
I want the set a wallpaper and using raw github url to fetch the wallpaper. Currently I am using this but it does work with Windows 10, but fails to set wallpaper on Windows Server 2008 R2. Any suggestions are welcome.
function RemoveWallpaper {
$code = @'
using System.Runtime.InteropServices;
namespace Win32{
public class Wallpaper{
[DllImport("user32.dll", CharSet=CharSet.Auto)]
static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni) ;
public static void SetWallpaper(string thePath){
SystemParametersInfo(20,0,thePath,3);
}
}
}
'@
Invoke-WebRequest -useb https://raw.githubusercontent.com/.....x.png -Outfile $env:temp\PSWall.jpg
$MyWallpaper="$env:temp\PSWall.jpg"
add-type $code
[Win32.Wallpaper]::SetWallpaper($MyWallpaper)
}
Hello Sir,
Instead of setting a bold Red wallpaper, I wanted to set a wallpaper from a raw GitHub page. How can I achieve this? I did try the code ( posted in the previous message) but it fails to work on 2008 R2. Any suggestions are most welcome!