I'm creating a script that will change users dekstop background 'color' to white. I'm pretty much a noob and haven't done many scripts, but this one isn't working and I can't see why. Can someone help please?
Option Explicit
' On Error Resume Next
Dim strKeyPath ' the portion of registry to read
Dim StrValueName
Dim strColor ' the target computer
Dim objReg ' holds connection to registry provider
Const HKCU = &H80000001 'HKEY_CURRENT_USER
strKeyPath = "HKEY_CURRENT_USER\Control Panel\Colors\Background"
strColor = "255 255 255" 'white
strValueName = "Background"
Set objReg=GetObject("winmgmts:\\" & "." & "\root\default:StdRegProv")
objReg.SetStringValue(HKCU,strKeyPath,strValueName,strColor)
Option Explicit
' On Error Resume Next
Dim strKeyPath ' the portion of registry to read
Dim StrValueName
Dim strColor ' the target computer
Dim objReg ' holds connection to registry provider
Const HKCU = &H80000001 'HKEY_CURRENT_USER
strKeyPath = "HKEY_CURRENT_USER\Control Panel\Colors\Background"
strColor = "255 255 255" 'white
strValueName = "Background"
Set objReg=GetObject("winmgmts:\\" & "." & "\root\default:StdRegProv")
objReg.SetStringValue(HKCU,strKeyPath,strValueName,strColor)