PDA

View Full Version : Change Another Users Wallpaper (W2K)



linuxstudent
03-30-2002, 10:15 PM
Hey does anybody know if it would be possible and if so how to change another users wallpaper in windows 2000 via the registry without knowing their login information?

Simon Clausen
03-31-2002, 06:21 AM
You can if you have administrator permissions, by changing the value in the desktop key under their SID. e.g. [HKEY_USERS\[USER SID]\Control Panel\Desktop].

Regards,

Simon Clausen
---
WinGuides.com - Windows Guide Network
<a target="_blank" href=http://www.winguides.com/>http://www.winguides.com/</a>

bcording
04-03-2002, 10:54 PM
So here is a VBScript i wrote to do just that. It writes the wallpaper to ALL login acounts including the .DEFAULT. Hope this helps!

Const HKU = &H80000003 '//HKEY_USERS

Set WshShell = WScript.CreateObject("WScript.Shell")
Set oReg = GetObject("winmgmts:!root/default:StdRegProv")

SID = enumkey(HKU, "")

For s = 0 To UBound(sid)
If InStr(SID(s),"_Classes") = 0 Then
WshShell.RegWrite "HKEY_USERS\" & SID(s) & "\Control Panel\Desktop\Wallpaper", "%windir%\BGInfo.bmp"
End If
Next

Function EnumKey(Key, SubKey)
Dim Ret()
oReg.EnumKey Key,SubKey, sKeys
ReDim Ret(UBound(sKeys))
For Count = 0 to UBound(sKeys)
Ret(Count) = sKeys(Count)
Next
EnumKey = Ret
End Function