$pathold = envget('path') envset('path', @scriptdir & ';' & envget('path')) $pathnew = envget('path') msgbox(0, 'Test', 'pathold = ' & $pathold & @CRLF & 'pathnew = ' & $pathnew) runwait(@comspec & ' /k echo %path%')
Now, under Windows 9x the msgbox() that displays $pathold and $pathnew shows the correct information: $pathnew = $pathold with the @scriptdir prepended to it. However, the @compspec command that displays %path% is incorrect: it shows the the value of $pathold. Under Windows XP, @comspec shows the correct %path% value.
I understand that EnvSet() creates temporary variables and that it's only valid for programs spawned directly by the script, but in this case it doesn't seem to be working. As far as I can tell, I'm doing exactly what I'm supposed to (running command.com from the AutoIt script), but it will not use the correct path. I also tried adding an EnvUpdate() call just before RunOnce(), but that had no effect.
Is this a bug, or am I just doing something wrong?