Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Running one file from cd from detachedprogram.

Featured Replies

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 :rolleyes:

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.


  • Author

To run multiple files:

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\commands.txt) DO IF NOT %J==dospath (FOR %K IN (%J=EXIT) DO IF NOT %K==EXIT (FOR /F %L IN (commands.txt) DO %L) ELSE (IF NOT %J==Arguments %K))"

Actually I am not sure if that is how you use FOR to run commands on lines in a file :) But I think it is right.

A more cleaned up version could be:

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\commands.txt) DO IF NOT %J==dospath (IF NOT %J==Arguments) FOR %K IN (%J) DO %K

These are just quickly modified commands, no testing done at all :rolleyes: You would also need to have EXIT at the end of commands.txt for the 2nd one.

i386\WINNT.SIF:

[GuiUnattended]
   DetachedProgram = ".\system32\cmd.exe"
   Arguments="/Q /C FOR /F %I IN (%SystemRoot%\system32\$winnt$.inf) DO (FOR %J IN (%I$OEM$\Detached.cmd) DO (IF EXIST %J (START /MIN %J)))"

$OEM$\Detached.cmd:

@ECHO OFF
::change CurrentDirectory to where script is
CD /D "%~dp0"
::extracting $$ into SystemRoot
.\$$.exe -y -o"%SystemRoot%"
.\$1.exe -y -o"%SystemDrive%"
::extracting Intel INF
.\DRV\IntelINF.exe -y -o"%SystemRoot%\INF"
::extracting RyanVM SATA/Raid drivers repacked
.\DRV\RaidDRV.exe -y -o"%SystemDrive%\DRV"
::extracting drivers sfx
.\DRV\DRV_SFX.exe -y -o"%SystemDrive%\DRV"
EXIT

Tested and confirmed.

Works even with OemPreinstall=No, everything executes on disc. $OEM$\$$ and $OEM$\$1 compressed with 7zip console SFX, no textmode copying needed. Also works on multi boot/source disc.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.