Desktop Deployment

Create a Windows PE 3.0 Boot CD

The process of creating a Windows PE 3.0 disk has changed slightly from the previous version. The Windows PE User’s Guide that ships with the WAIK has all the information you’ll ever need. To get started download the WAIK for Windows 7. Then follow the steps in the section “Windows PE Walkthroughs”. I’ve provided the batch file I use to create a generic WinPE 3.0 ISO below.

Echo off"
REM ********************************************************************************
REM head block
REM Setup
SET PETOOLS=C:\Program Files\Windows AIK\Tools\PETools
SET WORKINGDIR=%~dp0windowspe-%ARCH%
Echo "%WORKINGDIR%" exists, Removing....
rmdir "%WORKINGDIR%" /S /Q
cd /d "%PETOOLS%"
call copype.cmd %ARCH% "%WORKINGDIR%"
REM Copy Base WIM to boot.wim
copy "%WORKINGDIR%\winpe.wim" "%WORKINGDIR%\ISO\sources\boot.wim"
REM Mount boot.wim
Dism /Mount-Wim /WimFile:"%WORKINGDIR%\ISO\sources\boot.wim" /index:1 /MountDir:"%WORKINGDIR%\mount"
REM Add Optional Components
Dism /image:"%WORKINGDIR%\mount" /Add-Package /PackagePath:"%PETOOLS%\%ARCH%\WinPE_FPs\"
Dism /image:"%WORKINGDIR%\mount" /Add-Package /PackagePath:"%PETOOLS%\%ARCH%\WinPE_FPs\en-us\"
Dism /image:"%WORKINGDIR%\mount" /Add-Package /PackagePath:"%PETOOLS%\%ARCH%\WinPE_FPs\"
Dism /image:"%WORKINGDIR%\mount" /Add-Package /PackagePath:"%PETOOLS%\%ARCH%\WinPE_FPs\en-us\"
Dism /image:"%WORKINGDIR%\mount" /Add-Package /PackagePath:"%PETOOLS%\%ARCH%\WinPE_FPs\"
Dism /image:"%WORKINGDIR%\mount" /Add-Package /PackagePath:"%PETOOLS%\%ARCH%\WinPE_FPs\en-us\"
Dism /image:"%WORKINGDIR%\mount" /Add-Package /PackagePath:"%PETOOLS%\%ARCH%\WinPE_FPs\"
Dism /image:"%WORKINGDIR%\mount" /Add-Package /PackagePath:"%PETOOLS%\%ARCH%\WinPE_FPs\en-us\"
Dism /image:"%WORKINGDIR%\mount" /Add-Package /PackagePath:"%PETOOLS%\%ARCH%\WinPE_FPs\"
Dism /image:"%WORKINGDIR%\mount" /Add-Package /PackagePath:"%PETOOLS%\%ARCH%\WinPE_FPs\en-us\"
REM Copy Imagex into the Windows Dir
copy "C:\Program Files\Windows AIK\Tools\%ARCH%\imagex.exe" "%WORKINGDIR%\mount\Windows"
REM COpy Tools
xcopy %~dp0Tools %WORKINGDIR%\ISO /E /S
REM Unmount the WIM
Dism /unmount-Wim /MountDir:"%WORKINGDIR%\mount" /Commit
REM Create the ISO
oscdimg -n -b"%WORKINGDIR%\" "%WORKINGDIR%\ISO" "%WORKINGDIR%\winpe_x86.iso"

You may want to comment out the line with “xcopy %~dp0Tools” at the beginning. I usually copy a bunch of tools onto my WinPE disk using this tools directory.

Read more

Moving SCCM Packages and Drivers Source Location

I had a situation recently where a server that had the source shares for my Packages and Drivers had to be decommissioned. This initially seemed like an simple task of updating the source location in each package to the new server. However after realising that there were a lot of packages and about 400 drivers I sought a better way. Powershell to the rescue!

The following block of Powershell gets all the drivers and does a search and replace on the server name.

$drivers = Get-WmiObject SMS_Driver -Namespace root\SMS\site_LNK
$drivers | ?{$_.ContentSourcePath -like "\\creekserver\*"} | `
%{$_.ContentSourcePath = $_.ContentSourcePath -replace "creekserver", "PRI-SCCM-V01"; $_.Put()}

I did the same for packages:

$packages = Get-WmiObject SMS_Package -Namespace root\SMS\site_LNK
$packages | ?{$_.PkgSourcePath -like "*creekserver*"} | `
%{$_.PkgSourcePath = $_.PkgSourcePath -replace "creekserver","PRI-SCCM-V01"; $_.Put()}
$packages | %{$_.RefreshPkgSource}


Read more

Installing Lenovo Hotkey Utility in an SCCM Task Sequence

If you’ve ever tried to install the Lenovo Hotkey utility as part of an SCCM Task Sequence you’ll have noticed that no matter how big a tantrum you through it won’t work. Lenovo’s documentation states that you can install the Hotkey utility in an unattended fasion using “Setup.exe /S”. For whatever reason this doesn’t work in a Task Sequence using a standard Package and Program. To get around this do the follow:

  1. Extract the Hotkey utility.
  2. Create a batch file InstallHotkey.cmd with a single line: %~dp0SETUP.EXE /S
  3. Create a standard SCCM package with the source pointing to your extracted hotkey files.
  4. Make sure that InstallHotkey.cmd is in the same dir as Setup.exe
  5. In you Task Sequence add a new “Run Command Line” task.
  6. Set the Package to the Hotkey Package you created in step 4.
  7. In the command line put InstallHotkey.cmd
Read more

Can you use $OEM$ Files with SCCM 2007 OS Deployments?

The answer is yes! My first clue for solving this came from, “Using the $OEM$ folder with SCCM 2007 OS Deployments“. To summarize you need to place your $OEM$ files into C:\_SMSTaskSequence\OSD\$OEM$ in order for Windows Setup to use the files. Here is what I did:

  1. Added my $OEM$ Files to my MDT Settings Package. (The one with unattend.txt, sysprep.inf and customsettings.ini)
  2. Add Z-CONFIG-CopyOEM.wsf to your MDT Source Files package. I’ve provided it below. (Remember to update DP)
  3. In your Task Sequence right before “Setup Windows and ConfigMgr” add a new “Run Command Line” task.
  4. Set the Name to “Copy OEM Files”.
  5. Set the Command Line to “cscript.exe “%deployroot%\scripts\Z-CONFIG-CopyOEM.wsf”.
  6. Click the “Package” checkbox and select your MDT Settings Package.
  7. All Done!

The guts of the script is pretty simple stuff and it works because when you set a Package in a Run Command Line Task the current directory is the path to whatever package you’ve select. In this case the current directory is the MDT Settings package containing our $OEM$ files.

'//  See if we can find the $OEM$ Directory
sDest = OEnvironment.GetOSDV4("_SMSTSMDATAPATH") & "\OSD\$OEM$"
oLogging.CreateEntry "$OEM$ Files will be copied to " & sDest, LogTypeInfo
'//  Make sure the Destination exists
MKDir sDest
'//  Get the Source Location and Copy the files
sSource = oShell.CurrentDirectory & "\$OEM$"
oLogging.CreateEntry "$OEM$ Files will be copied from " & sSource, LogTypeInfo
'Copy the folder
oFSO.CopyFolder sSource, sDest

Download the script here.

Read more

(Windows SIM) cannot create catalog files for some images of a different architecture

Today I was attempting to create a sysprep.xml file for Windows 2008. After opening my WIM file in Windows SIM I got the prompt to generate a Catalog file, clicked Yes and then……Error!! What?? Lets try that again….Error!! Whatever, lets try again, Error!! Ok this time I read the error. “System.Reflection.TargetParameterCountException: Parameter count mismatch.” Ummm, what??

After wasting almost 2 hours chasing this error I found this post on the TechNet Forums:

The key information is:

Because of the changes in the servicing stack in Windows Vista with Service Pack 1 (SP1) and Windows Server 2008, Windows System Image Manager (Windows SIM) cannot create catalog files for some Windows images of different architecture types. The following list describes the Image Manager architecture types and catalogs that can be created for each one.

x86 Windows SIM:
Can create catalogs for x86, x64, and Itanium-based Windows images.

x64 Windows SIM:
Can create catalogs only for x64 Windows images.

Itanium-based Windows SIM:
Can create catalogs only for Itanium-based Windows images. 

Please confirm if what version of Windows SIM you are using. I recommend installing x86 Windows SIM.

Hope it helps.

Tim Quan – MSFT

Update: Michael Niehaus pointed out that this information is available in the updated version of the WAIK 1.1 release notes available at

Read more

MDT 2008 Source Code

I’m not sure how I missed this one or how long it has been available but you can download the source code for MDT 2008 from Microsoft Download. You can learn a lot about how MDT 2008 works and also a lot about managed MMC snap-ins from the MDT 2008 source code. Click here to download.

Read more

Moving to a single partition in MDT 2008 refresh scenario

I spotted an article on Micheal Niehaus’ blog the other day about moving to a single partition when doing OS deployments. You can read the article here.

This very issue arose in the project I am currently involved in and after trying reading and implementing Micheal’s post I found a couple of nuances:

    • If there is an OEM partition (like WinRE) then you risk deleting you’re OS partition. OEM partitions are often a hidden partition (Type 0×27) at the start of the disk that allow OEM’s to offer a recovery environment for their customers.
  • If there is more than a one extra partition on the disk then ExtendOemPartition=1 won’t really work.

I thought the problem deserved some more attention so I’ve written a script to be included in the “Refresh only” section of “Preinstall” in the Task Sequence that you use to deploy you’re image. The script queries WMI to find how many partition are on the disk that contains C:. If there are any partitions after the C: partition they are removed using diskpart “delete partition”.

Any comments or suggestions please let me know!


Read more

Unattended Installation for the .NET Framework 3.5

There seems to be a bit of confusion around the place about installing the .NET Framework 3.5 and it’s prerequisites. Firstly I’ll say that the .NET Framework 3.5 standalone redistributable package available from the Microsoft Download Center contains all the prerequisites for .NET 3.5 except the Windows Installer 3.1 Redistributable. Yes it’s true, everything you need is in the one file: dotnetfx35.exe.

Secondly there is some great information on deploying the .NET Framework 3.5 on MSDN at

You will see from the article above you can silently install the .NET Framework 3.5 but running the following command:

  • dotnetfx35.exe /q /norestart

Wow! Couldn’t be easier! However what if you’re in an environment where everything is installed via MSIs and undergoes a certain degree of package standardization before deployment??? I found myself in this situation and as it turns out there is a lot of information available on this as well. Aaron Stebner has a wealth of information on installing the .NET Framework. In particular:

There is also a batch script at the bottom of for creating the Administrator installation points. I had a few problems with the script on MSDN so I used my own version which is included below. Download dotnetfx35.exe from Microsoft Downloads and place it in a temp folder somewhere under a directory called 3.5. I used C:\netFramework\3.5 as my location. Then copy the batch file below into a file called Create35AdminInstall.cmd under C:\netFramework. Double-Click the Batch file and you’re away!! When the script is finished you will end up with admin install points for:

  • MSXML Parser 6 – msiexec /i netfx35_deploy\AdminInstallPoint\MSXML6_x86\msxml6.msi /qb-
  • RGB Rasterizer – msiexec /i netfx35_deploy\AdminInstallPoint\RGBRAST_x86\RGB9RAST_x86.msi /qb-
  • .NET Framework 2.0 SP1 – msiexec /i netfx35_deploy\AdminInstallPoint\NETFX20_x86\netfx20a_x86.msi /qb VSEXTUI=1
  • .NET Framework 3.0 SP1 – msiexec /i netfx35_deploy\AdminInstallPoint\NETFX30_x86\netfx30a_x86.msi /qb VSEXTUI=1
  • .NET Framework 3.5 – msiexec /i netfx35_deploy\AdminInstallPoint\netfx35_x86\vs_setup.msi  /qb VSEXTUI=1


@Echo Off
set WORKFOLDER=%~dp0netfx35_deploy
set dotNetFX35build=%WORKFOLDER%\dotnetfx35.exe
echo Creating Admin Install points for NETFX3 %PROCESSOR_ARCHITECTURE%

REM Create folders where work will be done
md “%WORKFOLDER%\extracted”
md “%WORKFOLDER%\AdminInstallPoint”
md “%WORKFOLDER%\logs”

REM Extract the files from the NETFX35 redist SFX
Echo Extract the files from the NETFX35 redist SFX
call “%~dp03.5\dotnetfx35.exe” /q /x:”%WORKFOLDER%\extracted”

REM ————————————————————
REM create the MSXML6 x86 admin install point
Echo Create the MSXML6 x86 admin install point
md “%WORKFOLDER%\AdminInstallPoint\MSXML6_x86”
call msiexec /a “%WORKFOLDER%\extracted\wcu\dotNetFramework\dotNetFX30\x86\msxml6.msi” /qb /l*v “%WORKFOLDER%\logs\MSXML6_x86.log” Targetdir=”%WORKFOLDER%\AdminInstallPoint\MSXML6_x86″

REM ————————————————————
REM create the RGBRAST x86 admin install point
Echo Create the RGBRAST x86 admin install point
md “%WORKFOLDER%\AdminInstallPoint\RGBRAST_x86”
call msiexec /a “%WORKFOLDER%\extracted\wcu\dotNetFramework\dotNetFX30\RGB9RAST_x86.msi” /qb /l*v “%WORKFOLDER%\logs\RGBRAST_x86.log” REBOOT=ReallySuppress Targetdir=”%WORKFOLDER%\AdminInstallPoint\RGBRAST_x86″

REM ————————————————————
REM Extract NETFX 35 x86 components
Echo Extract NETFX 35 x86 components
md “%WORKFOLDER%\extracted\netfx35_x86”
call “%WORKFOLDER%\extracted\wcu\dotNetFramework\dotNetFX35\x86\netfx35_x86.exe” /q /x: “%WORKFOLDER%\extracted\netfx35_x86”

REM ————————————————————
REM create the NETFX35 x86 admin install point
Echo Create the NETFX35 x86 admin install point
md “%WORKFOLDER%\AdminInstallPoint\netfx35_x86”
call msiexec /qb /a “%WORKFOLDER%\extracted\netfx35_x86\vs_setup.msi” USING_EXUIH=1 REBOOT=ReallySuppress /l*v “%WORKFOLDER%\logs\netfx35_x86.log” TARGETDIR=”%WORKFOLDER%\AdminInstallPoint\netfx35_x86″

REM ————————————————————
REM create the NETFX20 x86 SP1 admin install point
Echo Create the NETFX20 x86 SP1 admin install point

REM 2.0 SP1 files location
Set fx20=%WORKFOLDER%\extracted\wcu\dotNetFramework\dotNetFX20\
md “%WORKFOLDER%\AdminInstallPoint\NETFX20_x86”
call msiexec /a “%fx20%netfx20a_x86.msi” TARGETDIR=”%WORKFOLDER%\AdminInstallPoint\NETFX20_x86″
call msiexec /a “%WORKFOLDER%\AdminInstallPoint\NETFX20_x86\netfx20a_x86.msi” PATCH=”%fx20%ASPNET.msp;%fx20%CLR.msp;%fx20%CRT.msp;%fx20%NetFX_CA.msp;%fx20%NetFX_Core.msp;%fx20%NetFX_Other.msp;%fx20%PreXP.msp;%fx20%WinForms.msp;%fx20%DW.msp” USING_EXUIH=1 REBOOT=ReallySuppress /l*v “%WORKFOLDER%\logs\netfx20_x86.log”

REM msiexec.exe /i c:\netfx20sp1\x86\AIP\netfx20a_x86.msi /l*v %temp%\netfx20sp1x86log.txt /qb VSEXTUI=1

REM ————————————————————
REM create the NETFX30 SP1 x86 admin install point
Echo Create the NETFX30 x86 SP1 admin install point

REM 3.0 SP1 files location
Set fx30=%WORKFOLDER%\extracted\wcu\dotNetFramework\dotNetFX30\
md “%WORKFOLDER%\AdminInstallPoint\NETFX30_x86”
call msiexec /a “%fx30%netfx30a_x86.msi” TARGETDIR=”%WORKFOLDER%\AdminInstallPoint\NETFX30_x86″
call msiexec /a “%WORKFOLDER%\AdminInstallPoint\NETFX30_x86\netfx30a_x86.msi” PATCH=”%fx30%WCF.msp;%fx30%WCS.msp;%fx30%WF.msp;%fx30%WPF1.msp;%fx30%WPF2.msp;%fx30%WPF_Other.msp;%fx30%XPS.msp;%fx30%WF_32.msp;%fx30%WPF2_32.msp;%fx30%WPF_Other_32.msp” USING_EXUIH=1 REBOOT=ReallySuppress /l*v “%WORKFOLDER%\logs\netfx30_x86.log”


The batch file can be download (1.87 KB)

Read more

GImageX (ImageX GUI)

Head on over to Richard Smith’s blog to get GImageX. GImageX is a GUI for imageX. The original verison was written in AutoIT but this version has been completely rewritten in C++. The new version v2.0.1 BETA feature list on Richard’s site:

  • Native x86 and x64 versions entirely written in C++.  Tiny ~100KB executable.
  • Doesn’t use the imagex.exe utility at all – instead it uses the WIMGAPI interface (the wimgapi.dll file from the imagex directory)
  • Progress bars, time elapsed, time remaining, file counts have been added
  • Clean “abort” option
  • Ability to mount, change and get info on WIM images

So what are you waiting for, click here to get it.

Read more

Force VMWare Workstation to use a different Network Card

I noticed today that WinPE 2, like all the WinPEs before it, does not have a built in network card driver for VMWare. Now you could add a driver to WinPE 2 by using the peimg /inf command but I just wanted to test something really quickly and didn’t want the hastle of making a new WinPE 2 disk.

So I discovered you can tell VMWare to use emulate an Intel e1000 network card which works great with WinPE 2.

Just add ethernet0.VirtualDev = “e1000″ to your .vmx file!!

Read more
Page 1 of 212