How to Manually Create a Bootable USB Drive for SCCM OSD Deployment Using DiskPart

How to Manually Create a Bootable USB Drive for SCCM OSD Deployment Using DiskPart

  1. Insert USB stick (1g or larger) into computer. Note that the USB stick will be formatted during this procedure
  1. Open A Command Prompt – Click on Start, then Run and type “cmd” – Enter
  1. Start DiskPart – Type “diskpart” – Enter. The prompt should change to the below:


  1. Type “list disk” for a list of all the physical drives connected to the system. Find the number of the drive corresponding with your flash drive.  For the example below, it’s #5 (due to total size)


  1. Type “select disk X” – Enter (with X being the number of the disk)


Important –

Make sure you choose carefully as the next step will wipe the selected disk

  1. Type “clean” – Enter to wipe all data and partitions from disk


  1. Create Partition & Prep It – Enter the below steps to create a primary partition
    1. Type “create part pri” – Enter
    2. Type “select part 1” – Enter
    3. Type “format fs=ntfs quick” – Enter


  1. Make the drive bootable – Type “active” – Enter


  1. Exit diskpart by typing “exit” – Enter followed by typing “exit” – Enter again to exit the command prompt
  1. Extract all files & folders from your site’s bootable ISO file to the root of the newly created media – or – extract your site’s ISO file to a temporary folder and copy all files and folders to the root of the new media. Once done, the root of the USB drive should look similar to the below screenshot in Windows Explorer


Note:  Examples of applications which can extract ISO files are 7zip, UltraISO, MagicISO, WinRAR, and many others…

How to Manually Create a WIM File of a Pre-Configured Workstation

How to Manually Create a WIM File of  a Pre-Configured Workstation

 In SCCM and many other distribution applications, you may directly import a WIM file for deployment of an operating system or corporate image.  A WIM file is all of the mass data of a Windows OS and is found on all installation media as well.  Usually, it is a file named install.wim.  The below document will show you how to turn a workstation with an image you wish to deploy into a WIM file.


  • x1 – Windows 7 workstation configured to your specifications
  • x1 – Bootable WinPE USB Drive or Disc
  • x1 – External Hard Drive

Prepare Workstation

To be performed on the workstation whose configuration you want deployed

  1. Make all customizations and install all applications until you have the workstation exactly as you want it
  1. Disjoin the workstation from a domain if it is currently a member of one
  1. Optional – Create a backup before proceeding

Sys-prepping the Workstation

  1. On the workstation, run “c:\windows\system32\sysprep\sysprep.exe” Choose to enter “Audit Mode”, uncheck “Generalize”, choose “Reboot”, then click OK. The machine will reboot and come back up to the desktop without prompting for credentials.
  1. Make final changes you wish to perform. This may include deleting temporary local accounts and their matching local profiles.
  1. Once ready, run “c:\windows\system32\sysprep\sysprep.exe” again. This time, choose “Enter Out of Box Experience”, check “Generalize”, and choose “Shutdown.”  Click OK to proceed.

Capturing WIM File

  1. Plug in or insert your WinPe drive as well as the external USB drive. Turn on the computer and boot to the Windows PE USB drive or disc.  If you miss the prompt and it starts loading Windows, you must go through Windows Initial Configuration then start at step 4 again.  Once complete, you should be at a command prompt.
  1. Find out what devices have what driver letters and list them below. The easiest way to do this is to run a “dir” command on each drive letter and match its contents.
  • WinPE Media Drive Letter:
  • Workstation’s Hard Drive Letter:
  • External USB Drive Letter:

For the rest of this guide, we will assume that the WinPE media is E:, the Workstation Drive is D:, and the External USB Drive is F:

  1. Run the following command. Make sure you substitute the drive letters you noted appropriately

 “E:\imagex /compress fast /check /flags “Professional” /capture D: F:\install.wim “Windows 7 Professional” “Windows 7 Professional Custom”

 If entered correctly, the workstation’s OS will immediately start to compress into “install.wim” onto your External USB Drive. All custom or user specific files will not be included such as recycle bin files or page files.  After a few seconds, you will be given an estimate as to how much time is remaining for the capture.

  1. Once complete, you will be back at a command prompt. The install.wim file is now complete and created on your external drive.  Rebooting the workstation will start the Initial Windows Installation Wizard.

Examples of What Can You Do With a WIM File

  • Import into SCCM or other distribution application for deployment
  • Create Installation Media – Extract a Windows 7 OEM ISO to a temp folder. Once extracted, replace the install.wim in its “sources” folder with the install.wim you made.  You may then copy the extracted contents to a bootable USB drive or recreate an ISO file.
  • When Windows is installed from that custom installation now, it will have all of your changes and applications installed already!