--ooRexx
envArray = .array~new(10)
WMIObject =
.OLEObject~GetObject("WinMgmts:{impersonationLevel=impersonate}")
syspath = WMIObject~InstancesOf("Win32_Environment")
j = 0
cp = 0
pa = 0
/* collect Enviroment objects in REXX array */
do instance over syspath
j = j + 1
envArray[j] = instance
If (instance~name="Path") then
pa=j
If (instance~name="CLASSPATH") then
cp=j
end
-- pathValue=envArray[pa]~VariableValue
envArray[cp]~VariableValue("C:/")
say envArray[cp]~VariableValue
exit
::requires "OREXXOLE.CLS"
Still looking for a WMI solution.
Thanks in advance for your help
Reinhard
Reinhard S schrieb:
> I want do change the Path or Classpath with WMI. I can read it but not
> change it. Can somebody help me out here ? Thanks
>
> --ooRexx
>
> envArray = .array~new(10)
> WMIObject =
> ..OLEObject~GetObject("WinMgmts:{impersonationLevel=impersonate}")