Question

Locked

Batch files- testing and changing desktop wallpaper

By sam.dolph ·
Hi, we'd like to write a batch to see what wallpaper our users are currently using, and if it is our old pre-defined wallpaper, we'd like to push an update pointer to a new file containing our new logo, if the background is set to anything other than our old pre-defined logo we'd like to leave it as is, because it is likely a background that our users have set and would like to keep. I have had no problem writing the portion that changes the wallpaper, but I cannot get the syntax to test what the current wallpaper is set to. Here is the code which I have gotten so far:

@echo off
cls
call :quiet>nul 2>&1
::quiet

REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D "C:\filename.bmp"
%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters

This simply sets the background to c:\filename.bmp but does not test to see what the bg currently is, any and all help would be appreciated.
Thanks!

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

One option....

is to put that batch file on the server and push a PIF (shortcut) of it to the "c:\documents and settings\all users\desktop" directory and label the icon "Company Wallpaper". That way employees with non-conforming wallpaper can click it, and employees with approved "non-standard" wallpaper can ignore it.

Another option is to lock down the settings to keep them from changing it after you push out dunder-mifflin.bmp to the desktop.

It looks to me that the best you will see from a registry scrape in a batch file is going to show you the bmp (or jpg or gif) filename of the wallpaper. Copying the file to a reporting area on the server would be a complicated and drawn out process.

Even if you read the filename, if the file name was "bs.bmp" you wouldn't have any way to tell if the employee has a pic of bull excrement or Barbara Streisand.

It really sounds like you have two options.

1. Push out the corporate wallpaper.

2. Allow employees to take personal pics of their kids and dogs off of the screen and replace it with the company logo.

Really more of a policy predicament than a batch file problem.

Back to Windows Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums