Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing Path or Classpath with WMI

5 views
Skip to first unread message

Reinhard S

unread,
Jan 6, 2006, 3:06:53 PM1/6/06
to
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}")
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"

Reinhard S

unread,
Jan 19, 2006, 8:54:28 AM1/19/06
to
Is there another way to change the path or classpath permanently (windows) ?
(except changing it in the registry and then reboot or logoff-logon)

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}")

0 new messages