Well I have a script that is working fine under XP but it doesnt want
to work under NT. I am trying to write a multi String value in the
registry.



const HKEY_LOCAL_MACHINE = &H80000002
strKeyPath = "SOFTWARE\Patchlink.com\Gravitix\Agent\Policy"
MultValueName = "DriveExemption"
strComputer = "."
iValues = Array("F:\", "G:\", "H:\", "I:\", "J:\", "K:\",_
"L:\", "M:\", "N:\", "O:\", "P:\", "Q:\", "R:\",_
"S:\", "T:\", "U:\", "V:\", "W:\", "X:\", "Y:\", "Z:\" )
Set oReg=GetObject( _
"winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
oReg.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,_
MultValueName,iValues


Any Ideas?

Thanks

Ryan

Re: Script works on XP and not on NT Trying to write to the registry by hempguy

hempguy
Thu Oct 12 09:30:28 CDT 2006

probably a wmi issue. dont use it with NT


<ashline@yahoo.com> wrote in message
news:1160661701.568992.85980@h48g2000cwc.googlegroups.com...
> Well I have a script that is working fine under XP but it doesnt want
> to work under NT. I am trying to write a multi String value in the
> registry.
>
>
>
> const HKEY_LOCAL_MACHINE = &H80000002
> strKeyPath = "SOFTWARE\Patchlink.com\Gravitix\Agent\Policy"
> MultValueName = "DriveExemption"
> strComputer = "."
> iValues = Array("F:\", "G:\", "H:\", "I:\", "J:\", "K:\",_
> "L:\", "M:\", "N:\", "O:\", "P:\", "Q:\", "R:\",_
> "S:\", "T:\", "U:\", "V:\", "W:\", "X:\", "Y:\", "Z:\" )
> Set oReg=GetObject( _
> "winmgmts:{impersonationLevel=impersonate}!\\" & _
> strComputer & "\root\default:StdRegProv")
> oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
> oReg.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,_
> MultValueName,iValues
>
>
> Any Ideas?
>
> Thanks
>
> Ryan
>



Re: Script works on XP and not on NT Trying to write to the registry by Richard

Richard
Thu Oct 12 11:23:27 CDT 2006

WMI is not included with NT, but can be installed. Check the Microsoft site
for a download. If this isn't an option, maybe you can use the RegWrite
method of the wshShell object.

--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net

"hempguy" <hemp@guy.com> wrote in message
news:OJuW4rg7GHA.1012@TK2MSFTNGP05.phx.gbl...
> probably a wmi issue. dont use it with NT
>
>
> <ashline@yahoo.com> wrote in message
> news:1160661701.568992.85980@h48g2000cwc.googlegroups.com...
>> Well I have a script that is working fine under XP but it doesnt want
>> to work under NT. I am trying to write a multi String value in the
>> registry.
>>
>>
>>
>> const HKEY_LOCAL_MACHINE = &H80000002
>> strKeyPath = "SOFTWARE\Patchlink.com\Gravitix\Agent\Policy"
>> MultValueName = "DriveExemption"
>> strComputer = "."
>> iValues = Array("F:\", "G:\", "H:\", "I:\", "J:\", "K:\",_
>> "L:\", "M:\", "N:\", "O:\", "P:\", "Q:\", "R:\",_
>> "S:\", "T:\", "U:\", "V:\", "W:\", "X:\", "Y:\", "Z:\" )
>> Set oReg=GetObject( _
>> "winmgmts:{impersonationLevel=impersonate}!\\" & _
>> strComputer & "\root\default:StdRegProv")
>> oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
>> oReg.SetMultiStringValue HKEY_LOCAL_MACHINE,strKeyPath,_
>> MultValueName,iValues
>>
>>
>> Any Ideas?
>>
>> Thanks
>>
>> Ryan
>>
>
>