Adding Environment Variables
Posted 07 September 2004 - 12:46
Now I'm using func:
EzBatchAddPath (szKey, szPath, szRefDir, nPosition);
for adding the path in
Environment Variables, but this func uses Autoexec.bat for this purpose.
Can you suggest for me something else, something that suitable for every OS.
Thanks in advance!
Posted 08 September 2004 - 14:43
Itsn't suitable for me becouse the path is being saved as a parameter like %name%, and becouse of it, some programes aren't recognize it.
Posted 09 September 2004 - 02:36
'cause the code is pretty straight forward and I basically do the same thing for my own Path adjustments.
Posted 13 September 2004 - 12:27
When I use SetEnvPath call , the path is being added, but the rest of the existing path is damaged becouse of it, for example:
The path before:PATH=PATH=D:\oracle\ora81\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\Perl\bin\;C:\WINDOWS\system32
;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Borland\StarTeam SDK 6.0\Lib;C:\Program Files\
Microsoft SQL Server\80\Tools\BINN;d:\program files\Program;C:\Program Files\Borland\StarTeam SDK 6.
The path after:PATH=D:\oracle\ora81\bin;C:\Program Files\Oracle\jre\1.1.7\bin;C:\Perl\bin\;%SystemRoot%\system32;%S
ystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Borland\StarTeam SDK 6.0\Lib;C:\Program Files
\Microsoft SQL Server\80\Tools\BINN;d:\program files\Program;C:\Program Files\Borland\StarTeam SDK 6
===>You should notice that the path after contasins %SystemRoot% instead of C:\WINDOWS
===It seems like I miss something to end the set env
Posted 13 September 2004 - 14:54
%SystemRoot% is another internal system variable that equates to the Windows installation directory (e.g. C:\WINDOWS).
The actual registry value for the Path is always stored with that other variable, and then populated during bootup with the appropriate runtime value (i.e. %SystemRoot% --> C:\WINDOWS).
To see that in action, just open a Command Prompt and issue the path command.
Posted 14 September 2004 - 11:46
the problem was in nvtype of RegDBSetKeyValueEx:
I should have ensure REGDB_STRING_EXPAND
Posted 14 September 2004 - 15:07
Well glad to hear you got it working, and you're welcome.