DetachedProgram=".\system32\cmd.exe" Arguments="/C START FOR /F usebackq %I IN (`FINDSTR dospath %SystemRoot%\SYSTEM32\$WINNT$.INF`) DO FOR %J IN (%I$OEM$\Files\Drivers.exe) DO IF NOT %J==dospath (FOR %K IN (%J=EXIT) DO IF NOT %K==EXIT (%K -y /q /r:n -o%SystemRoot%\Temp) ELSE (IF NOT %J==Arguments %K))"
Drivers.exe is my 7-zip archive and -olocation is where it is extracted to.
Don't forget to update your OemPnPDriversPath.
I haven't tested this with an actual installation but this command does work in a command prompt.
The commands (START FINDSTR FOR IF) used here also work when called from a BAT file using cmd.exe and /C START from DetachedProgram so this should work, unless there is a length limit on Arguments and this exceeds it. It is quite long.
Please post with your experiences
Update: Ok I have found a problem with this and am working on it
Update #2: Ok, extracting now works. The problem is that it will also try to run:
"/C$OEM$\Files\$OEM$.exe EXIT -y /q /r:n -oC:\WINDOWS\Temp
Thats not a valid path though so shouldn't be a problem.
Actually, after some thinking, this can be used to run more than one program from cd using DetachedProgram during T-39. There could be a text file on the cd with the filenames of the programs to run and use another FOR statement to parse it and run them.