I'm trying to develop a script that will check to see if a screensaver is enabled, and if not, set it to the default Windows XP screensaver. So far, I've assembled quite a conglomeration of code using different sources, and I've worked out several errors, but this particular one I can't quite get past:
Option Explicit
Dim HKEY_CURRENT_USER
HKEY_CURRENT_USER= "&H80000001"
Dim objReg, strComputer, strKeyPath, strValue, ValueName
'strComputer = "."
strKeyPath = "Control Panel\Desktop"
Set objReg = GetObject("winmgmts:\\.\root\default:StdRegProv")
'***set variable strkeypath***
strKeyPath = "Control Panel\Desktop"
'***set variable valuename***
ValueName = "ScreenSaveActive"
'***set variable strvalue***
strValue = "1"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath, ValueName
That last line is where I get a Type Mismatch error. Any ideas?