Registry Key script

rasczak

Lifer
Jan 29, 2005
10,437
23
81
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\New Key"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath


line 5
char 28
error Expected ')'
code 800A03EE
Source: Microsoft VBscript compilation error

any clues?

Thanks
 

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,836
4,815
75
If I quote your post, there is a space after the _ at the end of the line. :)
 

Snapster

Diamond Member
Oct 14, 2001
3,916
0
0
Originally posted by: Ken g6
If I quote your post, there is a space after the _ at the end of the line. :)

You mean between & and _ there should be a space
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
Please make charles002 go away.

---

Spam has been canned. :)

Harvey
Senior AT Mod