Jump to content
Sign in to follow this  
ffdshow

StdoutRead from dism output

Recommended Posts

ffdshow

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 ?

Share this post


Link to post
Share on other sites
water

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 2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-01-27 - Version 1.3.3.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
ffdshow

#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

Share this post


Link to post
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
Sign in to follow this  

×