Jump to content

How to run a script before launching setup


Recommended Posts

Bascially, I have Windows 7 unattended (except for partition screen) from a hidden fat32 partition on my disk. I would like to modify it slightly to call diskpart to set partition 2 active, then continue with the unattended setup as normal. Anyone able to tell me quickly how I would do that?

Link to comment
Share on other sites


Do you want to just partition the disk, and still offer the user the ability to select the disk? I think it needs to go into your boot-image (WinPE.wim or install.wim) in startnet.cmd (either a call to a new script, or right in there). I think that's there in the install.wim, but I'm sure it's there in the WinPE.wim.

I can't find anything for the unattended xml file that gives you the ability to run custom scripts in the WinPE stage. I am curious what you end up doing.

Link to comment
Share on other sites

The following unattend.xml will start a vscript in the WinPE pass (assuming wpeinit is run). You can call diskpart from within that script (or directly).

<?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">

<RunSynchronous>

<RunSynchronousCommand wcm:action="add">

<Description>Lite Touch PE</Description>

<Order>1</Order>

<Path>wscript.exe X:\Deploy\Scripts\LiteTouch.wsf</Path>

</RunSynchronousCommand>

</RunSynchronous>

</component>

</settings>

</unattend>

/ Johan

Link to comment
Share on other sites

The following unattend.xml will start a vscript in the WinPE pass (assuming wpeinit is run). You can call diskpart from within that script (or directly).

<?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">

<RunSynchronous>

<RunSynchronousCommand wcm:action="add">

<Description>Lite Touch PE</Description>

<Order>1</Order>

<Path>wscript.exe X:\Deploy\Scripts\LiteTouch.wsf</Path>

</RunSynchronousCommand>

</RunSynchronous>

</component>

</settings>

</unattend>

/ Johan

What I actually want to do is have the system set Partition 2 active.

Here's the deal:

I have an ASUS EEE PC 1201N, with the following partitions:

Partition 1: 16MB Partition, ID=EF (Used for Boot Booster)
Partition 2: 100MB Partition, ID=07 (System Reserved)
Partition 3: 228GB Partition, ID=07 (Windows HD)
Partition 4: 4GB Partition, ID=1B (Hidden)

The 1201N has a BIOS hotkey (F9) that boots Partition 4. I modified that to contain a copy of the Windows 7 DVD (just Home Premium) and made it Unattended (had to put AutoUnattend.xml into boot.wim:2 for it to be read tho).

The problem arises that when you press F9, it sets Partition 4 active (that's all the F9 button does, searches for a 1B partition and activates it). That makes a little boo-boo in setup, as it installs the bootloader to Partition 4, which makes it a little less hidden.

So, my preferred setup would be to have the system boot from Partition 4, set Partition 2 active, then show the partition selection dialog (only so I can choose to format other partitions as needed) then continue. I already have an AutoUnattend to do everything except for the Diskpart, and I can post my exist xml if you would be able to provide exact changes, and maybe a sample "LiteTouch.wsf" (keep in mind, that due to the partition being hidden until Setup starts, I have to place AutoUnnattend.xml and any other files into boot.wim:2

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...