QUOTE (dera @ Dec 2 2009, 03:39 AM)

exactly which script in the VistaPE project was updated?
(anyway i used
this au3, only corrected 'REG_EXPAND_SZ' into 'REG_SZ'
and that was my experience:
if the complied au3 ran before the winpeshl.exe via "HKLM\Setup","CmdLine","mycommand.cmd" then the EnvUpdate() not needed at all
and it works also in BS Explorer building only from the WAIK,
if "HKLM\Setup","CmdLine", "winpeshl.exe" used and the complied au3 ran before the vpeldr.exe via the winpeshl.ini [LaunchApps] section
then EnvUpdate() doesn't help)
AFAIK NightMan never created a CDDrive environment variable. He replaced %CDDrive% with the appropriate drive letter as he created the shortcuts, on the fly. But he forgot to do that for the arguments portion of the shortcut specification.
My code is contained inb the script, but here it is:
CODE
$CfgFile = "vistape.cfg"
$CDLetter = False
$Letter = DriveGetDrive("all")
For $L = 1 To $Letter[0]
If (StringRegExp($Letter[$L], "(?i)^(A|B):$")) Then ContinueLoop
If (StringRegExp(DriveStatus($Letter[$L]), "READY") <> 0) Then
If FileExists($Letter[$L] & "\" & $CfgFile) Then
$CDLetter = StringUpper($Letter[$L])
ExitLoop
EndIf
EndIf
Next
If $CDLetter Then
RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment","CDDrive","REG_SZ",$CDLetter)
; Not many apps listen to this broadcast, but cmd.exe does. So this program
; should be run in a .cmd file so cmd.exe will listen and maintain the environment
; variable after this program exits.
EnvUpdate()
EndIf