Script to copy wallpaper by resolution / access restricted / overthinking?

By Lamune ·
I'm starting to think I'm getting way to involved here for a stupid little problem, so I'm asking for advice. I may be way overthinking this...

tl;dr version: What's the best way to automate the copying of files to a restricted user using the XP login scripts?

tl; version:
I need to update the desktop wallpaper on the whole network. Pushing out a file to all machines is no big deal, but not all the workstations in the system run the same size screen / resolution / aspect. The wallpaper has text on it (addr. & Ph. #s), so just throwing out stock image out and having Windows resize it looks horrible on half the machines.

We'd worked around this in the past by creating images for each resolution. That's done. Now I want to push them out to each machine, but checking each individually is a pain.

So, I patched together a vbscript that checks the resolution of the screen and copies over the appropriate file. (Copied down at the bottom there.) This works fine so long as the user is an admin, but for the machines that have the rights restricted it won't work- the script runs as the user is logged in to check the resolution, but it seems to be getting hung up with permissions then it can't copy files into the Windows folder.

I don't see anything in the group policy that would be stopping it, but there may still be something there I'm missing...

I don't want to give everyone admin rights, even for a few days, so now I'm looking at the commands to run the script / copy as an admin. ~_~

I've got a couple other ideas, like having the script just output the machine name and the resolution into a file on one of the public network drives and pushing the damn things out using EMCO, but that's admitting defeat at this point.

Before I get too much farther into this- is there something obvious I'm missing here?

Thanks for your time.

[The .vbs I've been playing with for reference:)

strComputer = "."

Set objWMIService = GetObject("Winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor where DeviceID = 'DesktopMonitor1'",,0)
For Each objItem in colItems
intHorizontal = objItem.ScreenWidth
intVertical = objItem.ScreenHeight

dim filesys, demofile
set filesys = CreateObject ("Scripting.FileSystemObject")

if intHorizontal = 1680 then
strCmdString = "copy Y:\Wallpaper\1680x1050\Wallpaper.bmp c:\windows\wallpaper.bmp"
set objWshShell = CreateObject("WScript.Shell")
set objExec = objWshShell.Exec(strCmdString)

elseif intHorizontal = 1440 then ...

(elseif... elseif... else...)

end if

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums