I mentioned in a previous post ( Changing XP Background (Wallpaper) Images ) about creating a ZENworks application to reset the background or wallpaper image. But I should have tested my app more thoroughly as it took a little tinkering to get it working. ZENworks veterans probably wouldn't have made this mistake, but as I'm new to version 11 (made the jump from 7) I did make the mistake.
The most common bundle action that I use is one of the "Launch" actions, whether it's an executable or an installer. Those actions by default run as the logged in user. What I found out is that "Registry Edit" actions by default execute as the System account. Which is probably great for making sure that the settings apply, but that's not so great when you're working in HKEY_CURRENT_USER. But there's an easy fix for that.
In the action properties just go to the Advanced tab and look at the "Run Action As" section. There's two ways to run it as System and as User. When you pick System there's one optional setting "Apply HKEY_CURRENT_USER changes to the logged in user's hive instead of .DEFAULT". The is fix is to check that box to make it work. Easy enough, right? I probably could have used the run as user option, but I tried checking the box worked and that fixed it, so I didn't try it with the user option set.
Here's picture so you can check that we're both looking at the same thing.
Problems and the occasional solution for technology issues encountered in a the K-12 education environment.
Showing posts with label wallpaper. Show all posts
Showing posts with label wallpaper. Show all posts
Monday, October 21, 2013
Wednesday, October 16, 2013
Changing XP Background (Wallpaper) Images
I know, I know, XP's old. But this is Practical School Tech and education is a little behind the times.
We had a couple of student systems where the students had set a background image by right-clicking images in IE and setting them as the wallpaper. Cute trick, right? But it's a pain to undo on a system where they don't get rights to the Display Properties page. The setting is stored per user (that way everyone can have their own) which is great unless your using a generic account that several students share. So how to undo it?
I though I'd start with the background image file. I did some Googling and most places said look in here
C:\Documents and Settings\Local Settings\Application Data\Microsoft\
But that isn't the right path, but it's close, it's really in
C:\Documents and Settings\Application Data\Microsoft\Internet Explorer
Or if you want to find it in a batch file (or just typing by hand), try this path instead
%AppData%\Microsoft\Internet Explorer
After finding the file I wanted to know where it is set in the registry. Since the image was set from inside IE file name was a very descriptive Internet Explorer Wallpaper.bmp. That's fairly unique, so I just searched through the registry for that file name. It turns out that path is stored in
HKEY_CURRENT_USER\Control Panel\Desktop
To clear the background image out I just blanked out the registry here.
HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper
After a reboot (or log off and log back on) the background image will be cleared and you'll be back to the pleasant soft blue.
But I didn't want to stop there. I wanted the change to go into affect immediately. I new when I changed the background through the Display Properties that the change happened right then. So that means there's a programmatic call somewhere that can make that happen. I had figured it was probably in some windows dll file and since wallpapers had been around so long that it was probably in one of the more common ones. A little more Googling and I came across this line
So I take all this information and roll it into a ZENworks bundle that deletes the key and then calls the UpdatePerUserSystemParameters to make it go into affect immediately.
We had a couple of student systems where the students had set a background image by right-clicking images in IE and setting them as the wallpaper. Cute trick, right? But it's a pain to undo on a system where they don't get rights to the Display Properties page. The setting is stored per user (that way everyone can have their own) which is great unless your using a generic account that several students share. So how to undo it?
I though I'd start with the background image file. I did some Googling and most places said look in here
C:\Documents and Settings\
But that isn't the right path, but it's close, it's really in
C:\Documents and Settings
Or if you want to find it in a batch file (or just typing by hand), try this path instead
%AppData%\Microsoft\Internet Explorer
After finding the file I wanted to know where it is set in the registry. Since the image was set from inside IE file name was a very descriptive Internet Explorer Wallpaper.bmp. That's fairly unique, so I just searched through the registry for that file name. It turns out that path is stored in
HKEY_CURRENT_USER\Control Panel\Desktop
To clear the background image out I just blanked out the registry here.
HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper
After a reboot (or log off and log back on) the background image will be cleared and you'll be back to the pleasant soft blue.
But I didn't want to stop there. I wanted the change to go into affect immediately. I new when I changed the background through the Display Properties that the change happened right then. So that means there's a programmatic call somewhere that can make that happen. I had figured it was probably in some windows dll file and since wallpapers had been around so long that it was probably in one of the more common ones. A little more Googling and I came across this line
%SystemRoot%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
I crossed my fingers and gave it a shot and what do you know, it actually worked.So I take all this information and roll it into a ZENworks bundle that deletes the key and then calls the UpdatePerUserSystemParameters to make it go into affect immediately.
Subscribe to:
Posts (Atom)