newtoclarion
Programmer
Hello All
I am trying to add a new path to "Path environment variable". (actually I want to add the path regardless the method)
my code retrieved the path correctly but it fails to update the path, even I tried to create a new variable in the registry but also failed.
Best Regards
I am trying to add a new path to "Path environment variable". (actually I want to add the path regardless the method)
my code retrieved the path correctly but it fails to update the path, even I tried to create a new variable in the registry but also failed.
Code:
Reg_pth1 CSTRING(255)
Reg_pth CSTRING(255)
code
Reg_pth = GETREG(REG_LOCAL_MACHINE,'SYSTEM\CurrentControlSet\Control\Session Manager\Environment','path')
Reg_pth1 = Reg_pth & ';c:\00'
if PUTREG(REG_LOCAL_MACHINE,'SYSTEM\CurrentControlSet\Control\Session Manager\Environment','path',Reg_pth1)
stop('not added')
end
Best Regards