J
JMasters
I have created a script to run after FBA that will modify the
registry to disable write caching on all of the IDE drives. It searches
the registry for IDE devices and adds the UserRemovalPolicy=3 setting
to each.
The script works fine on my XP Desktop but I am having problems
getting it to run on my XPE image. Our target size is limited so I am
trying to add as view components as possible.
Here is the script I am using:
---------------------------------------------------------------------------------
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strValueName = "UserRemovalPolicy"
dwValue = 3
strKeyPath = "SYSTEM\CurrentControlSet\Enum\IDE"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
strKeyPath2 = "SYSTEM\CurrentControlSet\Enum\IDE\" & subkey
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath2, arrSubKeys2
For Each subkey2 In arrSubKeys2
strKeyPath3 = strKeyPath2 & "\" & subkey2 & "\Device
Parameters\ClassPnP"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath3
oReg.SetDWORDValue
HKEY_LOCAL_MACHINE,strKeyPath3,strValueName,dwValue
Next
Next
--------------------------------------------------------------------------------
I'm not an expert at scripting. I pieced this together with some
examples I found online. The error I am getting when I run it is:
ActiveX component can't create object: "GetObject" on Line 5
Any ideas?
Thanks!
registry to disable write caching on all of the IDE drives. It searches
the registry for IDE devices and adds the UserRemovalPolicy=3 setting
to each.
The script works fine on my XP Desktop but I am having problems
getting it to run on my XPE image. Our target size is limited so I am
trying to add as view components as possible.
Here is the script I am using:
---------------------------------------------------------------------------------
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strValueName = "UserRemovalPolicy"
dwValue = 3
strKeyPath = "SYSTEM\CurrentControlSet\Enum\IDE"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
strKeyPath2 = "SYSTEM\CurrentControlSet\Enum\IDE\" & subkey
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath2, arrSubKeys2
For Each subkey2 In arrSubKeys2
strKeyPath3 = strKeyPath2 & "\" & subkey2 & "\Device
Parameters\ClassPnP"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath3
oReg.SetDWORDValue
HKEY_LOCAL_MACHINE,strKeyPath3,strValueName,dwValue
Next
Next
--------------------------------------------------------------------------------
I'm not an expert at scripting. I pieced this together with some
examples I found online. The error I am getting when I run it is:
ActiveX component can't create object: "GetObject" on Line 5
Any ideas?
Thanks!