Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to get this particular segment of vbscript to work on Windows 7 and it's just not doing it. No errors or anything.

const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,"EnableLinkedConnections",1

It works fine on XP and I'm running it as an admin.

Thanks

share|improve this question
If you find "Command Prompt" on the Start Menu, right click -> Run As Admin; then enter wscript your_script.vbs does it work? If so you're hitting UAC. – Chris S Feb 7 '11 at 19:13
Are you using 32- or 64-bit Windows? Try calling the SetDWORDValue method via ExecMethod_ and then checking the OutParameters.ReturnValue. – Helen Feb 7 '11 at 20:14
Chris S. You are the winner. That is it exactly. Now the question I have is how to defeat the pesky UAC as a startup script (not login) – Dayton Brown Feb 11 '11 at 16:28

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.