Bat changes XP wallpaper, but not on Win 7???

April 30, 2011 at 22:46:44
Specs: Windows 7 (64 Bit)
Bat file uses "rundll32.exe user32.dll,UpdatePerUserSystemParameters" to change desktop wallpaper dynamically works fine on Windows XP SP2, but not on Windows 7 (64 bit). Any ideas???

See More: Bat changes XP wallpaper, but not on Win 7???

Report •

May 1, 2011 at 05:18:18
I don't have any specific information on this but methods using rundll32.exe tend to be very OS specific and unreliable. Many of these commands worked in older systems but not in Vista and later.

Report •

May 2, 2011 at 09:25:31
Yeah, Google's telling me that method no longer works.

On the plus side, with Windows 7, you have access to Powershell. It's the first MS scripting language capable of making Win32 API calls:

$wallpaper = "c:\somePath\someWallpaper.jpg"
$script:spi = Add-Type –memberDefinition @”
[DllImport("user32.dll", CharSet=CharSet.Auto)]
public static extern bool SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
"@ -name "Win32spi" -passThru
$spi::SystemParametersInfo(20, 0, $wallpaper, 3)

How To Ask Questions The Smart Way

Report •

Related Solutions

Ask Question