Jump to content

StdoutRead from dism output


ffdshow
 Share

Go to solution Solved by ffdshow,

Recommended Posts

Hello,

I want to inject some drivers into boot.wim from two versions of Windows 7 sources.

In the script, I want to check if boot.wim is 32-bit or 64-bit. This can be done with a command like this:

dism /Get-WimInfo /WimFile:F:Windows7sourcesboot.wim

The output looks like this:

Deployment Image Servicing and Management tool
Version: 6.1.7601.17514

Details for image : F:\Windows7\sources\boot.wim

Index : 1
Name : Microsoft Windows PE (x64)
Description : Microsoft Windows PE (x64)
Size : 1.187.717.206 bytes

Index : 2
Name : Microsoft Windows Setup (x64)
Description : Microsoft Windows Setup (x64)
Size : 1.264.587.270 bytes

The operation completed successfully.

I guess I should use StdoutRead command, but how ?

Link to comment
Share on other sites

StdOutRead has an example that shows how to use Run and StdOutRead to do what you need.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • Solution

#include <Constants.au3>
$DOS = Run(@ComSpec & " /c dism /Get-WimInfo /WimFile:F:\Windows 7\sources\boot.wim", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
ProcessWaitClose($DOS, 2)
$Output = StdoutRead($DOS)
If StringInStr($Output, "Microsoft Windows Setup (x86)") Then
   ;   dism command here for injecting 32-bit drivers in a 32-bit boot.wim
ElseIf StringInStr($Output, "Microsoft Windows Setup (x64)") Then
   ;   dism command here for injecting 64-bit drivers in a 64-bit boot.wim
EndIf

Edited by ffdshow
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...