Jump to content

Recommended Posts

Posted (edited)

I have an xml file that I call using wpeinit ro change the resolution of my WinPE. However, running the command through winpeshl.ini doesn't work. Any Ideas?

Here are the files/commands:

I have the following file

DisplayChange.xml which contains the following:


<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-Setup" processorArchitecture="x86"
publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Display>
<ColorDepth>32</ColorDepth>
<HorizontalResolution>1024</HorizontalResolution>
<VerticalResolution>768</VerticalResolution>
</Display>
<EnableNetwork>true</EnableNetwork>
<EnableFirewall>true</EnableFirewall>
<PageFile>
<Path>C:\Pagefile.sys</Path>
<Size>1024</Size>
</PageFile>
</component>
</settings>
</unattend>

And I would like to run the following command from within the Winpeshl.ini file:

wpeinit.exe, /unattend=X:\Windows\Displaychange.xml

My WINPESHL.ini file for simplicity looks like this:


[LAUNCHAPPS]
x:\windows\system32\startnet.cmd
x:\windows\system32\wpeinit.exe, /unattend=X:\Windows\Displaychange.xml
x:\windows\system32\cmd.exe

I have tried switching the order of the wpeinit command and there is no difference. However, if I run the command by itself from a command prompt it works and therefore changes the display. Any idea why this is happening?

Edited by Eagle710

Posted

Change the Displaychange.xml filename to Unattend.xml and save it in the Root of the Wim Image, then change the command in Winpeshl.ini to x:\windows\system32\wpeinit.exe,-unattend

Posted

Change the Displaychange.xml filename to Unattend.xml and save it in the Root of the Wim Image, then change the command in Winpeshl.ini to x:\windows\system32\wpeinit.exe,-unattend

So place unattend in the root of the wim as in X:\unattend.xml?

and in winpeshl.ini is just -unattend not unattend.xml?

Posted

Change the Displaychange.xml filename to Unattend.xml and save it in the Root of the Wim Image, then change the command in Winpeshl.ini to x:\windows\system32\wpeinit.exe,-unattend

So place unattend in the root of the wim as in X:\unattend.xml?

and in winpeshl.ini is just -unattend not unattend.xml?

Yes, no need to specify the filename if the file is placed in Root

Posted

You have a syntax error. Try this:

[LAUNCHAPPS]
x:\windows\system32\startnet.cmd
x:\windows\system32\wpeinit.exe, "/unattend=X:\Windows\Displaychange.xml"
x:\windows\system32\cmd.exe

Notice the quotes I added. winpeshl requires quotes after the comma. Another example here:

http://www.passmark.com/forum/showpost.php?p=7183&postcount=7

Tripredacus,

The quotes worked great and my issue is resolved. How did you determine you needed the quotes? It drove me nuts.

Thanks for your help.

Eagle710

Posted

The documentation doesnt say anything about quotes..... for anything following the comma I suppose we have to do that...

WinPESHL Info

Is it correct that in order to include multiple option with a command to use quotes around the whole command and options?

Posted

Yes you need full quotes. If I remember (today was an insane day) I will report this error to my TAM. Anyways, a disclaimer, I do not use Technet or the WAIK documentation, I only use the OPK documentation.

Posted

OK sounds good... is that just the documentation that comes with WAIK?

Well I typically do not use the info on Technet. I just read the CHMs that are part of the install. But sometimes I will post a link to Technet because I can't post the info from the OPK CHMs, there is a little difference. :whistle:

I remember reading it in WAIK for Vista before I had to stop using it.

  • 3 weeks later...
Posted

Now what if I want to have a command run like this:

X:\Windows\system32\diskpart.exe, "/s X:\Windows\system32\script.txt > X:\Windows\temp.log"

I want to run the diskpart script and redirect the output to a file. Do I really have to make another file that will act as the middle man and store this entire command and call that one cmd/batch from within WinPESHL?

Posted

Is this related to you trying to detect a USB Drive? There is always another way, but this method would work. The only difference is that you are going to need to put in a sleep type command, so that the next part of your script does not try to read the log file before it exists, or is done being saved, etc.

Posted

Is this related to you trying to detect a USB Drive? There is always another way, but this method would work. The only difference is that you are going to need to put in a sleep type command, so that the next part of your script does not try to read the log file before it exists, or is done being saved, etc.

Right now I would like the file created and thats it....no sleep needed.... but the command i put above doesnt work in winpeshl.ini..any ideas why?

Posted

I am wondering if winpeshl.ini does not like the > character. Try having winpeshl.ini run a .cmd file instead, and put your diskpart command in that file instead. Make sure you don't make it exit, or have winpeshl.ini run something after the .cmd so the PE doesn't exit and reboot on you, like have it open notepad after it runs the script, so then you can check it.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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