My problem is that I need to add a specific folder to the environment variable PATH.
Could someone please tell me how I can modify the environment variable "path" programmatically?
There is a GetEnvVar(), but there is no SetEnvVar()

Thanks,
Vishwa
Posted 31 August 2004 - 00:17
Posted 31 August 2004 - 07:47
CODE |
prototype BOOL KERNEL32.SetEnvironmentVariable(BYVAL STRING, BYVAL STRING); if (GetEnvVar ( "Path", svPath)==0) then if !(svPath % svYourPath) then svPath = svPath + ";" + svYourPath; if (!SetEnvironmentVariable("Path", svPath)) then MessageBox ("Could not add path to environment!", WARNING); endif; endif; else MessageBox("Error retrieving environment!", WARNING); endif; |
Edited by Jochen, 31 August 2004 - 07:55.
Posted 31 August 2004 - 16:12
Posted 01 September 2004 - 09:58
Posted 01 September 2004 - 16:20