Archive for October, 2008

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

Finding Path lengths greater than MAX_PATH

If you’ve ever had anything to do with maintaining or migrating a fileserver you will probably have experienced issues with MAX_PATH. In Windows the maximum length for a path is MAX_PATH, which is defined as 260 characters. One of the most common errors for MAX_PATH is “Can’t access this folder. Path is too long.” This usually happens when users (those pesky users!) map a drive half way down a directory structure and started creating new files and folders.

You can find more information about MAX_PATH at the following locations:

I’ve seen a number of different ways of finding paths that are too long but my favourite at the moment is using the Microsoft Log Parser. Details:

Once you’ve downloaded LogParser you can run the following command to output a CSV file of paths greater than 250 characters:

LogParser “SELECT Path, Size FROM C:\*.* WHERE STRLEN(Path) > 250″ -i:FS -preserveLastAccTime:ON -o:CSV > Results.csv

Just change the “C:\*.*” to the location you want to check for long paths and Bob’s your uncle.

Read more

Wpeinit.exe cannot find wdi.dll

I booted an SCCM Task Sequence boot image this morning in VMWare Workstation and received the following error: “This application has failed to start because wdi.dll was not found. Re-installing the application may fix this problem“.


Oh of course that makes perfect sense……arhhh actually no. After a bit of searching it appears as thought this is an issue with the VMWare Workstation Drivers. Earlier I’d added the entire drivers directory from the VMWare Tools directory to SCCM. Bad move! All you need is the the vmxnet and scsi directories. Remove all the others, re-generate the Boot Image and you’re away!

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