Ahhh... it seems the strSubKey is getting incremented one last time before it leaves the loop. So the value is one higher than I want it. To fix the issue I added:
strSubKey = Right("000" & CStr(strSubKey - 1), 4)
After Loop and before oReg.SetStringValue HKLM, strKeyPath & strSubKey...
Thanks for all your help guys, I really appreciate it. I checked out the links and started to do more research on loops. I re-did the script and approached with a Do loop:
const HKLM = &H80000002
strComputer = "."
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &...
Is it possible the SetStringValue method I'm using won't work? Since the reg string I want to add does not yet exist, would I have to create the reg string, then set it?
Thanks.
PHV, I replaced strSubKey1 = strSubKey1 + 1 with strSubKey1 = Right("000" & CStr(strSubKey1 + 1), 4) like you suggested, but it still seems to be stuck in loop. I even replaced the funky string I want to add with "test" to see if it would do that, and nothing, still looping.
Do I need to...
Thanks for the responses guys, I'll try that change today and report back.
Other than that, does the syntax look correct to you guys?
My only other concern is trying to apply the string value "AT+CGDCONT=2,\"IP\",\"wap.cingular\"". I'm using Notepad++ to help me see the code and I don't think...
I apologize in advance for what I'm about to ask. Our dedicated scripter in the office just got laid off and somehow I got tasked with a project involving VBScript, of which I know nothing about.
I'll provide screenshots of what I want to ultimately do, to try to help with the verbiage...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.