SetEnvironmentVariable("Vdrive","")
should purge the variable. Instead the variable still exists (with empty assignment).
The equivalent API function works correctly.
For example (at the console) the command SET Vdrive
should display:
---- The environment variable is not defined
and not:
---- Vdrive=
Existing, but empty variables may have unpredictable consequences.
Purge environment variable
Purge environment variable
Horst.
Re: Purge environment variable
Try RemoveEnvironmentVariable()
quidquid Latine dictum sit altum videtur
Re: Purge environment variable
Sorry, I did not expect this, because I was used to the DOS/Windows behaviour.freak wrote:Try RemoveEnvironmentVariable()
Now I always have to remember to use this construct for setting variables:
Code: Select all
If Vdrive
SetEnvironmentVariable("Vdrive",Vdrive)
Else
RemoveEnvironmentVariable("Vdrive")
EndIf
Maybe a little hint in the SetEnvironmentVariable help would be helpful.
Horst.