Jump to content

Winpeshl.ini Assistance


Eagle710

Recommended Posts

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
Link to comment
Share on other sites


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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 weeks later...

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

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
  • Recently Browsing   0 members

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