Archive for the ‘WinPE 3.0’ Category

Sysprep a Windows 7 Machine – Start to Finish V2

Monday, January 18th, 2010

SPREAD THE WORD, TOGETHER WE HAVE CONQUERED SYSPREP :)

This is version 2 of a step by step guide on Sysprepping a Windows 7 machine from start to finish. I cannot take full credit on this because my first article had so many helpful comments and discussions that this is simply a combination of all the good advice written into a working guide. (I would especially like to thank George for his input on Cscript for auto activation and Nathan for input on Sysprep Audit Mode). This will guide you through the following:

- Audit Mode
- Building the unattend.xml file in WSIM
- copyprofile=true command to copy the default profile (no manual copy)
- Prompt for a computer name
- Enable Administrator account
- Administrator account logs in first time automatically
- Activate windows automatically with Cscript;
- Successfully copy over taskbar icons;
- Delete unattend.xml file automatically upon completion of re-image.

Here is a list of what you will need:

- Latest version of WAIK : KB3AIK_EN.iso Version 1.0
- Windows Vista or Windows 7 Machine to build the XML file on
- ISO or DVD of Windows 7 Installation (x32 or x64)
- WinPE Boot Environment : BrianLeeJackson WinPE 3.0 BootLoader

First we are going to walk through building the unattend.xml file (answer file) and then we will walk through the actual Windows 7 imaging process.

PART 1 – XML FILE CREATION

Step #1

If you have a Windows 7 installation DVD, insert it now. Or if you have an ISO of 7, go ahead and extract it to a folder on your desktop. (I recommend 7-zip).

Step #2

Launch Windows System Image Manager. Your start menu should look like the image below:

Windows 7 WAIK Version 1

Windows 7 WAIK Version 1

Step #3

Under the “Windows Image” header, right click and select new image.

Windows System Image Manager

Windows System Image Manager

Step #4

You will now want to browse to the .CLG file in your Windows 7 installation (I am using Windows 7 Enterprise x64 in my example). It is located in the sources folder. See Image below. You can select either the .clg file or the install.wim. Both will have the same result.

Selecting CLG File - WSIM

Selecting CLG File - WSIM

Step #5

Now we need to create a new answer file. Go to the file menu and select “Create New Answer File.” Right after creating one, go ahead and simply go to file menu and select “Save Answer File.” This will give your XML file a name and save location. I chose to name mine unattend.xml. Now you see we have two category folders, Components and Packages. Under the Components folder you see that we have 7 options:

-1 windowsPE
-2 offlineServicing
-3 generalize
-4 specialize
-5 auditSystem
-6 auditUser
-7 oobeSystem

Step #6

These are very important as these are the steps in which the unattend.xml file is sequenced.
The next part is a little confusing. You are going to add components, from under the “Windows Image” section on the bottom left hand side to the passes on your Answer File. To add a component, you can right click on them and select “add to # pass”. There are many different options you can add, but they have to be done in a certain order and pass otherwise your sysprep might fail. I am simply going to use the one I created as the example.

Answer File - Unattend.xml

Answer File - Unattend.xml

Here is more information about adding options under the passes:

1 windowsPE

Nothing required in my example.

2 offlineServicing

Nothing required in my example.

3 generalize

amd64_Microsoft-Windows-Security-SPP_6.1.7600.16385_neutral

Set 1 for SkipRearm to allow up to 8 rearms

4 specialize

amd64_Microsoft-Windows-Deployment_6.1.7600.16385_neutral

      1. Order: 1
        path: net user administrator /active:yes
        WillReboot: Never
    1. RunSynchronousCommand[Order="1"]

  1. RunSynchronous

amd64_Microsoft-Windows-Security-SPP-UX_6.1.7600.16385_neutral

SkipAutoActivation: true

amd64_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral

Computer Name: Leave blank (we will deal with this at the end)
CopyProfile: true
Registered Organization: Microsoft (you must leave this in this section)
Registered Owner: AutoBVT (you must leave this in this section)
ShowWindowsLive: false
TimeZone: Pacific Standard Time

You can delete other sub-header components if you don’t need them.

5 auditSystem

Nothing required in my example.

6 auditUser

Nothing required in my example.

7 oobeSystem

amd64_Microsoft-Windows-International-Core_6.1.7600.16385_neutral

InputLocale: en-us
SystemLocale: en-us
UILanguage: en-us
UserLocale: en-us

amd64_Microsoft-Windows-Shell-Setup_6.1.7600.16385_neutral

RegisteredOrganization: Your Company Name
RegisteredOwner: Your Name

  • AutoLogon
      1. Password: Administrator Password
    1. Enabled: true
      LogonCount: 5
      Username: administrator

  • FirstLogonCommands
      1. CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX (windows 7 license key)
        Order 1
        RequiresUserInput: false
        CommandLine: cscript //b c:\windows\system32\slmgr.vbs /ato
        Order 2
        RequiresUserInput: false
    1. SynchronousCommand[Order="1"]

      SynchronousCommand[Order="2"]

  • OOBE
    1. HideEULAPage: true
      NetworkLocation: Home
      ProtectYourPC: 1
  • UserAccounts
          1. Password: Administrator Password
        1. Action: AddListItem
          Description: Local Administrator
          DisplayName: Administrator
          Group: Administrators
          Name: Administrator

      1. LocalAccount[Name="Administrator"]

    1. AdministratorPassword: Administrator Password
      LocalAccounts

    If you have questions, look at my image above to see full layout of components, it should help.

    Step #7

    K, now go ahead and save your answer file as unattend.xml.

    Step #8

    If you want the sysprep to prompt for a computer name you need to remove a line from your XML file. Open up your XML file you saved with notepad and remove the following line:

    Unattend.xml Computer Name

    Unattend.xml Computer Name

    PART 2 – IMAGING PROCESS / RUNNING SYSPREP

    Step #9

    Install Windows 7 (Enterprise) from CD or USB flash drive, when you arrive at the welcome screen and it asks you to create a username, hit ctrl+shift+f3.
    This will reboot your machine and put your windows build in ‘audit’ mode.

    Step #10

    On reboot, you’ll automatically be logged in under the built-in Administrator account. A sysprep GUI box will appear, but you can close it and NOW begin to customize your profile.

    Step #11

    Install any software/drivers, make any profile customizations, etc.
    If you need to reboot, the computer will boot you back into the Administrator account. You will be stuck in this audit mode until you run sysprep with the /oobe parameter. After doing so, sysprep will delete/clean up the Administrator account, but if you have copyprofile=true in your unattended answer file, it will copy the customized Admin account to the default profile before deleting it.

    Step #12

    On the PC you are going to be running sysprep on, you need to create a folder called scripts in this directory: %WINDIR%\Setup\. Now you are going to create a CMD file within the %WINDIR%\Setup\Scripts directory. Right click and make a new text file called SetupComplete.txt. Remove the .txt extension and replace that with .cmd. You now have a SetupComplete.cmd file which windows will read the first time it boots up from the sysprep. We need to place a script inside the CMD file. Edit the cmd file with notepad and insert this line: del /Q /F c:\windows\system32\sysprep\unattend.xml. This script will delete your unattend.xml file after it has been used. The unattend.xml file is also copied to the C:\Windows\Panther directory, so you will want to add a second line to the CMD file, del /Q /F c:\windows\panther\unattend.xml. If you have passwords or cd keys stored in that xml file you don’t have to worry about it being left on the computer.

    UPDATE AS OF JUNE 16TH: Read my Taskbar Icons Tutorial before continuing.

    Step #13

    Once you have everything configured correctly, Copy or move your unattend.xml file to : C:\windows\system32\sysprep. Now to run sysprep, navigate to that sysprep folder, hold SHIFT and right click and select “Open New Command Windows Here”. Next, input the following commands:

    sysprep /generalize /oobe /shutdown /unattend:unattend.xml

    Step #14

    Turn the computer back on and boot to WinPE 3.0 environment (USB stick or CD/DVD). You can use my BrianLeeJackson WinPE3.0 BootLoader to boot up from USB or CD and capture your image. Capture image and save image to network location.
    A Dell 960 or GX755 is a good standard for capturing when you want a generic image for use with multiple systems. Might require injecting additional drivers for 3rd party brands, HP, etc. Most should work though right out of the box.

    Step #15

    On reboot, Windows will run out of the box, as the /oobe is intended. As long as you put your cd key into the unattend.xml file, windows will be activated automatically in the background, you will be automatically logged into the administrator account, and the unattend.xml file is deleted. You are now ready to use the computer or join it to the domain. Enjoy!

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    New WinPE 3.0 Scripts + Driver Packages Update

    Wednesday, November 11th, 2009

    I just updated my WinPE 3.0 boot environment scripts. They are completley free to download. You can either click on the green button on the right hand side or visit this link http://blog.brianleejackson.com/winpe-3-0-boot-environment-scripts.

    CHANGES/UPDATES AS OF NOVEMBER 12, 2009

    • Added new Windows 7 winpe.bmp wallpaper for WinPE 3.0 Boot Environment, both x32 and x64.
    • Added new drivers for WinPE 3.0 environment including some netbooks and HP eCopy machines, x32.
    • Added the newest stable version of GimageX v2.0.17, x32 and x64.
    • Removed GHOST from packages, x32 and x64.

    Also, if you have enjoyed my site or gotten useful information from it; even if I saved you an hour from compiling different information then I have accomplished my goal. However, I am now getting 10-20 emails per day asking questions about sysprepping, Windows 7 deployment, etc. It is getting hard to keep up. And with this increase in traffic comes an increase in bandwidth. If I have helped you in any way please feel free to donate any amount on the right hand side so I can keep this blog going. I have some great new tutorials planned as I jump deep into the Acresso’s AdminStudio 9.5 Repackager for Windows 7 x64.

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    Sysprep a Windows 7 Machine – Start to Finish

    Tuesday, September 8th, 2009

    THIS IS OLD, PLEASE SEE NEW VERSION 2, CLICK HERE

    This is a step by step guide on Sysprepping (and yes, I have made sysprepping a verb now) a Windows 7 machine from start to finish. This will guide you through building the unattended XML file, having the administrator profile copy over to default profile, and fixes for what is right now a not 100% working system from Microsoft. This is something I would have easily paid for when first starting this process. I don’t know why Microsoft can’t hand us a 100% working process. There will always be fixes, even with the RTM release.

    Here is a list of what you will need:

    - Latest version of WAIK : KB3AIK_EN.iso Version 1.0
    - Windows Vista or Windows 7 Machine to build the XML file on
    - ISO or DVD of Windows 7 Installation (x32 or x64)
    - WinPE Boot Environment : BrianLeeJackson WinPE 3.0 BootLoader

    Once you have WAIK installed on a machine your Start Menu should look like the image below:

    Windows 7 WAIK Version 1

    Windows 7 WAIK Version 1

    Go ahead and launch the Windows System Image Manager. Picture of the program is below.

    Windows System Image Manager

    Windows System Image Manager

    We now need to open a Windows 7 image. If you have an installation DVD, insert it now. Or if you have an ISO of 7, go ahead and extract it to a folder on your desktop. (I recommend 7-zip). Back in Windows System Image Manager (WISM) go to the file menu and select “Select Windows Image”. You will now want to browse to the .CLG file in your Windows 7 installation (I am using Windows 7 Enterprise x64 in my example). It is located in the sources folder. See Image below.

    Selecting CLG File - WSIM

    Selecting CLG File - WSIM

    Now we need to create a new answer file. Go to the file menu and select “Create New Answer File.” Right after creating one, go ahead and simply go to file menu and select “Save Answer File.” This will give your XML file a name and save location. Now you see we have two category folders, Components and Packages. Under the Components folder you see that we have 7 options:

    - 1 windowsPE
    - 2 offlineServicing
    - 3 generalize
    - 4 specialize
    - 5 auditSystem
    - 6 auditUser
    - 7 oobeSystem

    These are very important as these are the steps in which the XML file is sequenced.

    The next part is a little confusing. You are going to add components, from under the “Windows Image” section on the bottom left hand side to the passes on your Answer File. To add a component, you can right click on them and select “add to # pass”. There are many different options you can add, but they have to be done in a certain order and pass otherwise your sysprep might fail. I am simply going to use the one I created as the example.

    Download my Windows 7 x86 Sysprep XML File
    Download my Windows 7 x64 Sysprep XML File

    WSIM Passes

    WSIM Passes

    Here is more information about adding options under the passes:

    1 WindowsPE

    Nothing required in my example.

    2 OfflineServicing

    Nothing required in my example.

    3 Generalize

    amd64_Microsoft-Windows-Security-SPP_neutral

    Set 1 for SkipRearm to allow up to 8 rearms

    4 Specialize

    amd64_Microsoft-Windows-Security-SPP-UX_neutral

    SkipAutoActivation: true

    amd64_Microsoft-Windows-Shell-Setup_neutral

    Computer Name: * (Randomly generated name, use this to test)
    CopyProfile: false (doesn’t quite work, we will do that manually later)
    Registered Organization: Microsoft (you must leave this in this section)
    Registered Owner: AutoBVT (you must leave this in this section)
    ShowWindowsLive: false
    TimeZone: Pacific Standard Time

    5 AuditSystem

    Nothing required in my example.

    6 AuditUser

    Nothing required in my example.

    7 OobeSystem

    amd64_Microsoft-Windows-International-Core_neutral

    InputLocale: en-us
    SystemLocale: en-us
    UILanguage: en-us
    UserLocale: en-us

    amd64_Microsoft-Windows-Shell-Setup_neutral

    RegisteredOrganization: YourCompanyName
    RegisteredOwner: YourName

    Under amd64_Microsoft-Windows-Shell-Setup_neutral component, you will have a subheader for OOBE:

    HideEULAPage true
    NetworkLocation: Home
    ProtectYourPC: 1

    Under amd64_Microsoft-Windows-Shell-Setup_neutral component, you will have a subheader for UserAccounts:

    You will want to add both an administrator password and another local account with administrator rights and password.

    If you have questions, look at my image above to see full layout of components, it should help. Also, you might have additional component headings that I didn’t mention. If you are simply testing first time, just delete them for now. You can add all sorts of components later on, you should do a successful sysprep if this is your first time, better to keep it simple and to the basics.

    K, now go ahead and save your answer file. The building of the XML file is now done. That is the worst part. You would think that the sysprep process would get easier as new OS’s come out, but its pretty much the exact opposite.

    Prepping your machine

    K, now it is time to get your machine that you want to sysprep and capture an image of ready to go. First, you are going enable the administrator account on the computer. To do this on Windows Vista or Windows 7, open up a command prompt (Run as Administrator) and input the following command:

    net user administrator /active:yes

    Hit enter and you should see “successfully enabled Administrator Account”.

    So you should currently have two accounts on your computer. The account you are currently logged into and the Administrator account which you just enabled. You are going to want to customize all of your preferences, favorites, bookmarks, taskbar, etc. under the currently logged in account. Once you have everything just perfect, you are going to reboot the computer and login to the administrator account. This next part is very important. You are going to go to “My Computer” and then to Organize and folder and search options. Go ahead and select “Show hidden files, folders, and drives”. Picture is below.

    Show Hidden Files, Folders, and Drives

    Show Hidden Files, Folders, and Drives


    No go to “My Computer” and you are going to rename the Default folder to Default.bak (The CopyProfile setting in Sysprep on Windows7 does not seem to work yet). Next, copy your other user account, the one you customized everything in, right click on it and select copy. Then paste within that same window. It is going to come out as USERNAME – COPY. Now rename this copied folder to Default. Now after you sysprep your computer it will create all new accounts from that default profile folder using all your customized options.

    The last thing we need to do is disable the WMP sharing service. This is a bug in Windows 7 and hopefully will eventually be fixed. If you don’t disable this before the sysprep your sysprep will simply fail to run. Go to run, msconfig, and then disable the “Windows Media Player Networking Sharing” service.

    Now you are ready to sysprep your computer and capture an image of it!! Finally! So, grab that XML file you created earlier and you are going to place it on the machine you built your image on. Copy or move it to : C:\windows\system32\sysprep.

    Now to run sysprep, navigate to that sysprep folder, hold SHIFT and right click and select “Open New Command Windows Here”.
    Next, input the following commands:

    sysprep /generalize /oobe /shutdown /unattend:NAMEOFYOURANSWERFILE.xml

    Your computer will now run the sysprep process, removing SID, etc, and then shutdown. You can have it restart, but shutdown is always safer if you have a ton of things going on. You will need to boot to your WinPE Boot environment when your computer starts back up. If you miss the first time upon boot up, you will have to re-input your sysprep commands. So do a shutdown, not a restart.

    You can use my BrianLeeJackson WinPE3.0 BootLoader to boot up from USB or CD and capture your image. Once you capture your image, you are all done. You now have a sysprepped Windows 7 image. I have performed this task on over 120 computers so far and it has been flawless. The hard part was getting everything configured correctly. I hope this documentation helps someone out there, I know I would have killed for a tutorial like this when I first started :)

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    How to Capture and Deploy Image (.wim) Without Sysprep

    Saturday, August 8th, 2009

    If you are using WinPE 2.0 or WinPE 3.0 to capture your PC images (.wim files) and deploy them you have probably run into a little problem when trying to deploy an image of Vista or Windows 7 when not first running sysprep. The problem is that if you try to re-deploy an image of a nonsysprepped image of Vista or 7 that the BootMGR will be broken. Follow the steps below to fix this problem.

    Microsoft Windows 7 Icon

    Microsoft Windows 7 Icon

    Step #1

    I am assuming you have captured your image already and are ready for deployment. Go ahead and boot up your image deployment software (WinPE 2.0 or WinPE 3.0).

    Step #2

    In my other articles I describe how to use DiskPart and also avoiding the hidden partition before deploying a new image. I suggest reading them.

    Step #3

    After you have deployed your non-sysprepped image you need to run the following commands: (I have a batch file I use to do this).

    bcdedit /set {default} device partition=c:
    bcdedit /set {default} osdevice partition=c:
    bcdedit /set {bootmgr} device partition=c:

    Step #4

    This will fix the BOOTMGR problem when deploying a non-syprepped image in Vista or 7. Enjoy!

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    How to Sysprep XP Machine SP3 / Copy Administrator Profile to Default Profile

    Tuesday, August 4th, 2009

    I realize this article is a little old since Windows 7 is coming out here in a few days, but I thought I would share it with you in case your business has decided to stick with XP for now. When you sysprep a machine you are basically wanting to clone the settings from that machine to another one. You also want it to copy those changes to each profile, correct? Well, in order for the sysprep to successfully copy over the administrator profile to the default profile for each user you have to add an extra line to the sysprep.inf file or else it won’t work in Service Pack 3 like it did in Service Pack 2.

    Step #1

    The first step is to download the Sysprep App which is included in the CAB file for Windows XP Service Pack 3 Deployment Tools. (Download Sysprep Tool)

    Step #2

    Next go to the PC you are going to be sysprepping and create a folder on the root of the C: drive called sysprep.

    Step #3

    Next you will need to extract the contents of the deploy.cab file you downloaded in Step #1 to the sysprep folder on the root of the C: drive.

    Step #4

    Now we are going to run the sysprep Setup Manager. Double click on setupmgr.exe.

    Sysprep Setup Manager

    Sysprep Setup Manager

    Step #5

    Click Next and it is going to ask you whether you want to modify an existing Answer File or create a new one. We are wanting to create a new one, so again click next.

    Sysprep - New or Existing Answer File

    Sysprep - New or Existing Answer File

    Step #6

    You now have three options: Unattended Setup, Sysprep Setup, or Remote Installation Services (RIS). In this example we are going to select the Sysprep setup option and then click next. (This creates a sysprep.inf file)

    Sysprep - Sysprep.inf File

    Sysprep - Sysprep.inf File

    Step #7

    Select Windows XP Professional and click next. (This will also work on Windows XP Home, Windows Server 2003 Standard, Web, and Enterprise.)

    Sysprep - Windows XP Professional

    Sysprep - Windows XP Professional

    Step #8

    In this step it is asking you if you want to fully automate the installation. That is up to you, either way works fine. In this example I will be using the “No, do not fully automate the installation.”

    Sysprep - Fully Automate or Not?

    Sysprep - Fully Automate or Not?

    Step #9

    Now we are at the configuration page. There is a lot in here so I am not going to go into detail. In fact, you don’t even need to input anything here for the sysprep to just work. However, everything you input in here will save you time and help shape your image.

    Sysprep - Configuration Page

    Sysprep - Configuration Page

    Step #10

    Once you are all done, you should be at the bottom and selected on “Identification String”; click Finish and it is going to prompt you for a location to create and save the sysprep.inf file. The default location is fine, as it will need to be within that sysprep folder on your C: drive. Once you hit ok you will then need to click “Cancel”. There is no close button.

    Sysprep - Saving the Sysprep.inf File

    Sysprep - Saving the Sysprep.inf File

    Step #11

    Now you should verify the sysprep.inf file by double clicking on it and opening it up with Notepad.

    Sysprep - Verifying the Sysprep.inf File

    Sysprep - Verifying the Sysprep.inf File

    Step #12

    There were a few changes with Windows XP Service Pack 3 and sysprep. The administrator’s profile is no longer copied over to the default profile. You will need to add a line within the sysprep.inf file to regain this important function. Under the InstallFilesPath section add this:

    UpdateServerProfileDirectory=1

    Once done, hit save.

    Sysprep - Adding line to sysprep.inf so the administrator profile will copy over to default profile

    Sysprep - Adding line to sysprep.inf so the administrator profile will copy over to default profile

    Step #13

    Now you are ready to start the sysprep, reboot, and capture your sysprepped image. Double click on the sysprep.exe and then select the following three options in order: Use Mini-Setup, Shutdown Mode: Reboot, and click Reseal. Make sure you have your media ready to capture your image. If you reboot fully without booting to your capturing software it will ruin the sysprep and you will have to redo the sysprep.

    Sysprep - Preparation Tool 2.0

    Sysprep - Preparation Tool 2.0

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    How to Install Windows 7 From a Flash Drive / USB Stick

    Friday, July 31st, 2009

    This is a short guide on how to install Windows 7 onto a computer from a USB Flash Drive / USB Stick or Portable Hard Drive. Since read speeds are faster from USB drive than your CD-ROM drive, this actually decreases the install time for Windows 7.

    OCZ Flash Drive - Install Windows 7

    OCZ Flash Drive - Install Windows 7

    Step #1

    The first thing you will need to do is format your USB Flash Drive or Portable Hard Drive so that your computer will read it as a bootable drive. So plug your flash drive into a workstation.

    Step #2

    Open up Command Prompt / CMD (located in Program Files->Accessories) and type the following commands:

    DiskPart
    List Disk (this will list the disks currently plugged into your computer. Most likely, the C: drive on that computer will be listed as disk 0, and you will have to look down the list to see which disk your flash drive is. Look at the corresponding disk sizes to easily figure it out.)
    Select Disk 3 (I am using 3 as example for assigned flash drive)
    Clean
    Create Partition Primary
    Select Partition 1
    Active
    Format FS=NTFS Quick
    Assign (you can assign a particular drive letter if you want, example: assign=E:)
    Exit (this will exit DiskPart)
    Exit (this will exit CMD)

    Step #3

    Next you will need to either insert your Windows 7 CD and browse to the CD or open up your Windows 7 ISO and browse to the folders within it. (If you are using ISO, I would suggest extracting the contents to a new folder)

    Step #4

    Next you will need to spoof your flash stick so that the computer will think it is an install CD. From within the root of the Windows 7 CD or ISO contents, right click while holding shift key and select “Open Command Windows Here”. This will open up a Command Prompt window within that directory. Then input the following commands:

    cd Boot
    bootsect /nt60 E: (I am using drive letter E: as my flash drive)
    exit (exits command prompt)

    Step #5

    Next simply copy over the entire contents of your windows 7 CD or ISO to your flash drive.

    Step #6

    Reboot the computer your are wanting to install Windows 7 on with the flash drive plugged in, hit the boot key (normally F12, DEL, or ESC) to select the boot device, boot to your flash drive, and it will go immediately to the Windows 7 Setup screen.

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    Formatting WinPE 3.0 USB Flash Drive – (DISM)

    Friday, June 19th, 2009

    In my previous article I wrote about how to create the WinPE 3.0 environment, add drivers, mount the .WIM file, add batch scripts, etc. Here are the steps for creating the bootable flash drive.

    Step #1

    Open up Command Prompt

    You can do the first step within a normal command prompt window or within the WAIK Deployment Tools Command Prompt Window.

    Step #2

    Diskpart

    This launches the DiskPart program which is included within Windows Vista x32, x64 and Windows 7 x32, x64.

    Step #3

    List Disk

    Before you do anything you will want to see which disk is which on your computer.

    Step #4

    select disk 1

    You will want to pick the corresponding disk in which you want to use for your bootable flash drive. Careful, because this will completely erase the disk you select.

    Step #5

    clean

    This cleans up your disk.

    Step #6

    create partition primary

    This creates the partition on your flash drive.

    Step #7

    select partition 1

    This selects the partition you just created in Step #6.

    Step #8

    active

    This marks the select partition as active.

    Step #9

    format fs=fat32 quick

    This will format your flash drive in FAT32 format. Make sure you use the quick command otherwise it will do a standard format and will take a while. For bootable flash drives the quick format will always be fine.

    Step #10

    assign

    This will assign the next available drive letter to your flash drive. (You can also specify which drive letter you would like it to be assigned)

    Step #11

    exit

    This exits DiskPart.

    Step #12

    exit

    This exits CMD.

    Step #13

    Then just copy the contents of the “c:\winpe_x86\ISO\” folder in which you have your WinPE 3.0 environment created in the previous article and you are ready to boot up on a flash drive to WinPE 3.0. Enjoy!

    Here are the commands all together:

    Diskpart
    list disk [See which drive is which]
    select disk 1 [corresponding to disk on your computer]
    clean
    create partition primary
    select partition 1
    active
    format fs=fat32 quick
    assign
    exit
    exit

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks

    Deployment Image Servicing and Management (DISM) – WinPE 3.0 Boot Environment

    Friday, June 19th, 2009

    I recently compiled a new library of commands since the upgrade from WinPE 2.0 to WinPE 3.0. With Windows 7 coming along they released a new way to create bootable USB sticks using Deployment Image Servicing and Management (DISM.exe). You might be asking yourself, what could I use this for? We are using it at my work to re-image computers, capture backup images, mount images, etc. There are many other uses for it but I will not get into that here. I have literally done this procedure a couple hundred times. In a future article I will show you how to write a simple batch script to automate this process. But it helps to understand what is going on with each command in case you have trouble. Batch scripts never work 100% of the time.

    You will need the following to proceed:
    Windows® Automated Installation Kit (AIK) for Windows® 7 RC (Download from Microsoft) : 05.01.09

  • Windows® Automated Installation Kit (AIK) for Windows® 7 RC (Download from Microsoft) : 08.06.09
  • Bootable Flash drive (500MB or larger)
  • Once you have installed WAIK then you will need to browse to your start menu and click on “Deployment Tools Command Prompt”. I have provided a picture below.

    DISM

    DISM

    Once you have launched DTCP you will need to follow through the commands I have compiled below. The first one I have provided a screenshot.

    DISM – Step #1 – Prep/Cleanup

    DISM /Cleanup-Wim

    The DISM cleanup command simply cleans up any previous wims/mounts you have been working with. If you do this a lot, you will need to use this command otherwise you will start receiving errors from previous wims possibly still left on the system.

    DISM Step #1

    DISM Step #1

    DISM – Step #2 – Copy WinPE 3.0 to your local C Drive

    copype.cmd x86 c:\winpe_x86
    copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim

    This creates a winpe_x86 folder on your C: drive and then copies the contents of the WinPE folder from the WAIK installation to your folder.

    DISM – Step #3 – Mounting .Wim File on your local C Drive

    Dism /Mount-Wim /WimFile:C:\winpe_x86\winpe.wim /index:1 /MountDir:C:\winpe_x86\mount

    This command mounts the wim file that was copied over in step #2 so that you can browse the system32 folder and insert your custom scripts, etc.

    DISM – Step #4 – Adding Packages to your WIM

    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\winpe-wmi.cab”
    Dism /image:C:\winpe_x86\mount /Add-Package /PackagePath:”C:\Program Files\Windows AIK\Tools\PETools\x86\WinPE_FPs\en-us\winpe-wmi_en-us.cab”

    There are many packages you can add to your WINPE boot environment, these are two I always add to mine.

    DISM – Step #5 – Adding Drivers to WinPE

    DISM /image:c:\winpe_x86\mount /Add-Driver /driver:C:\YOUR_FOLDER_OF_INF_DRIVERS\ /recurse

    A nice addition to DISM over the previous peimg command in WINPE 2.0 is the ability to add drivers with the /recurse command. The /recurse command now allows us to simply have all of our drivers in their own directory and tell DISM to scan the root folder and everything beneath it. The number of sub directories won’t matter. I have a huge library of drivers, for example, you will want to have the network and vga drivers for anything that you boot up to in the WinPE environment. By adding the network driver to your WinPE boot environment, it allows you to access network shares for capturing and deploying .wim images.

    DISM – Step #6 – Adding Custom Scripts, Batch Files, Etc.

    xcopy /e /y “C:\YOUR_FOLDER_OF_SCRIPTS” C:\winpe_x86\mount\Windows\System32\

    Without adding anything to your WinPE boot environment you will simply be left with a command prompt window when booting to it on a computer. I have added over 15 different batch scripts with different functions. Click here to download my WinPE discs. One thing I highly suggest adding is GImageX. GImageX is a very small GUI program that you can add to be able to capture, deploy, and mount images within the WinPE boot environment. I have provided a picture of GImageX GUI below.

    For WinPE 3.0 Boot Environment - Mount, Deploy, Capture Images

    For WinPE 3.0 Boot Environment - Mount, Deploy, Capture Images

    DISM – Step #7 – Unmounting your finished .WIM

    Dism /Unmount-Wim /MountDir:C:\winpe_x86\mount\ /Commit

    This commits the final changes to your .WIM file and anything you added to it. It is very important to unmount your .WIM file when you have finished.

    DISM – Step #8 – Copies your .WIM to Boot ISO

    copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim /Y

    DISM – Step #9 – Creates bootable .ISO of WinPE 3.0

    oscdimg -n -bc:\winpe_x86\etfsboot.com c:\winpe_x86\ISO c:\winpe_x86\winpe_x86.iso

    Now, if you are wanting to use a flash stick you will need to format a flash stick in a certain way, and then simply copy the contents of the c:\winpe_x86\ISO\ to your flash drive. And thats it! Stick it in a computer, restart, and boot to it. The .ISO made in step #9 can simply be burned to a CD with Nero or other program capable of making bootable CD and then you can boot to it in the same way.

    DISM – Step #10 – Optional Backup

    xcopy /e /y “C:\winpe_x86″ E:\BACKUP_FOLDER_FOR_LATEST_BOOT_BUILD\

    This step is optional, but I always like to keep a backup for the future. Also, if you ever need to create another bootable flash stick or CD you can simply go to your backup and grab the files.

    Share and Enjoy:
    • Twitter
    • Facebook
    • Digg
    • del.icio.us
    • Technorati
    • StumbleUpon
    • Google Bookmarks