- Capture and apply Windows, system, and recovery partitions
- Capture the customized partitions
- Step 1: Determine which partitions to capture
- Step 2: Prepare to capture partitions
- Step 3: Capture images for each customized partition.
- Step 4: Save images to the network or another safe location.
- Apply the images
- Step 1: Prepare to apply partitions
- Step 2: Apply the partitions
- Step 3: Verify that it worked
- How to take and annotate screenshots on Windows 10
- Take a screenshot
- Annotate snips with Snip & Sketch
- New-Windows Image
- Syntax
- Description
- Examples
- Example 1: Capture an image of a drive for a WIM file
- Parameters
Capture and apply Windows, system, and recovery partitions
When you’re deploying Windows using the WIM format, and using customized partitions, a customized system partition or an additional utility partition, learn how to capture the right partitions to apply to new PCs.
If you don’t need custom partitions, you usually can just capture the Windows partition, and then use files from that image to set up the rest of the partitions on the drive. See Capture and Apply Windows using a single WIM file.
If you’re capturing using the FFU format, you’ll be fine — FFU captures all of the partitions on the drive.
Capture the customized partitions
Step 1: Determine which partitions to capture
This table shows the types of partitions that you must capture and those that are managed automatically.
If you’re deploying both UEFI and BIOS systems, you can reuse your primary and logical partitions across UEFI-based and BIOS-based devices, but not the other partition types.
Partition type | Should you capture this partition? | Can you reuse the same WIM on UEFI and BIOS firmware? |
---|---|---|
System partition (EFI System Partition or BIOS system partition) | Optional. If only a simple set of partition files is required, you don’t have to capture this partition. | No |
Microsoft Reserved partition (MSR) | No | No |
Primary partitions (Windows partitions, data / utility partitions that you’ve added) | Yes | Yes |
Recovery partition | Optional. If you haven’t customized this partition, you don’t have to capture it. | No |
Extended partition | No | No |
Logical partitions (Windows partitions, data / utility partitions that you’ve added) | Yes | Yes |
Step 2: Prepare to capture partitions
If you’ve booted the Windows image, generalize it so that it can be deployed to other devices. For more information, see Sysprep (Generalize) a Windows installation.
Start your reference device by using WindowsВ PE.
At the WindowsВ PE command prompt, type diskpart to open the DiskPart tool.
Check to see if the partitions that you want to capture have drive letters assigned.
If any of the partitions you want to capture don’t already have a drive letter assigned, continue:
List the disks in your PC:
Select the primary hard disk:
View the partitions:
Select a partition that needs a drive letter:
Assign a letter to the partition with the assign letter command. For example,
Type exit to return to the WindowsВ PE command prompt.
For more information, see the DiskPart Help from the command line, or Diskpart Command line syntax.
Step 3: Capture images for each customized partition.
At the WindowsВ PE command prompt, capture each customized partition, for example:
For more information about using the DISM tool to capture an image, see DISM Image Management Command-Line Options.
Step 4: Save images to the network or another safe location.
Connect an external drive, or connect to a safe network location, for example:
If prompted, provide your network credentials.
Copy the partitions to your network share. For example,
Apply the images
Step 1: Prepare to apply partitions
Start your destination device by using WindowsВ PE.
Connect an external drive, or connect to a safe network location, for example:
If prompted, provide your network credentials.
Wipe the hard drive and create new partitions.
To apply to multiple devices, save the Diskpart commands into a script and run them on each new device. For examples, see Configure UEFI/GPT-Based Hard Drive Partitions or Configure BIOS/MBR-Based Hard Drive Partitions. Example:
Where D: is a USB flash drive or other file storage location.
In these DiskPart examples, the partitions are assigned the letters: System=S, Windows=W, and Recovery=R.
Change the Windows drive letter to a letter that’s near the end of the alphabet, such as W, to avoid drive letter conflicts. Do not use X, because this drive letter is reserved for Windows PE. After the device reboots, the Windows partition is assigned the letter C, and the other partitions don’t receive drive letters.
If you reboot, WindowsВ PE reassigns disk letters alphabetically, starting with the letter C, without regard to the configuration in Windows Setup. This configuration can change based on the presence of different drives, such as USB flash drives.
Optional: speed up the image capture by setting the power scheme to High performance:
Step 2: Apply the partitions
Windows and data partitions: Apply the image(s), example:
where W: is the Windows partition.
System partition: You can either:
Configure the system partition by using the BCDBoot tool. This tool copies and configures system partition files by using files from the Windows partition. For example:
Apply a custom image
Where S: is the system partition
Recovery partition:
a. You can either:
Copy the Windows Recovery Environment (RE) tools into the recovery tools partition.
Where R: is the recovery partition
Apply a custom image
b. Register the location of the recovery tools, and hide the recovery partition using Diskpart. You can use our sample script or perform the steps manually:
Diskpart steps for UEFI:
Diskpart steps for BIOS:
Step 3: Verify that it worked
Reboot the device ( exit ). Windows should boot.
If the device doesn’t boot, (for example, if you receive the error message: Bootmgr not found. Press CTRL+ALT+DEL) check the steps for setting up the system partition:
- See BCDBoot command-line options for more info about copying boot files to the system partition.
- Use the DiskPart tool to check to make sure that the system partition is set to Active.
Complete the out of box experience (OOBE) as a new user, and check the recovery partition:
Check that in File Explorer that the Recovery partition is not visible.
View the partitions exist, either by right-clicking Start and selecting Disk Management, or by using diskpart (Open a command prompt as an administrator > diskpart > select disk 0 > list partition > exit ).
How to take and annotate screenshots on Windows 10
Sometimes the easiest way to make a copy of something is to take a snapshot of your screen. While you can already capture your screen using your keyboard’s PrtScn button, you can now press Windows logo key + Shift + S to open the new modern snipping experience (also called the snipping bar), then drag the cursor over the area you want to capture.
Here are some common ways to take and annotate screenshots in Snip & Sketch on Windows 10.
Take a screenshot
Option 1: Using the Snip & Sketch app
Press the Start button and enter Snip & Sketch in the search field.
Press the New button to start snipping with the snipping bar.
The snipping bar allows you to capture the following types of snips:
Rectangular snip. Drag the cursor around an object to form a rectangle.
Free-form snip. Draw a free-form shape around an object.
Full-screen snip. Capture the entire screen.
Once you snip an area of your screen — the snipped image is added to your clipboard and you can paste it immediately in another app. A screen prompt will also allow you to annotate, save or share it using the Snip & Sketch app.
Option 2: With the Print Screen key
While the PrtScn key already captures your full screen and sends it to your clipboard, opening the snipping bar provides you with more snipping tools you can use for precise snipping. For better control of your screen capturing options, you can opt to have your PrtScn key open the new snipping bar instead of having to type Windows logo key + Shift + S.
To turn on the new snipping feature keyboard shortcut Select Start > Settings > Ease of Access > Keyboard
Option 3: With the Window logo key + Shift + S shortcut
Pressing the S key + Windows logo + Shift keys down initiates the snipping bar at any time.
Annotate snips with Snip & Sketch
Opening images for editing with Snip & Sketch
To open an image from Snip & Sketch, select Open File or drag and drop an image from apps like File Explorer or Photos in the Snip & Sketch window.
Annotating images with Snip & Sketch
Snip & Sketch provides a few tools for annotating images, namely pen, pencil and highlighter. Once you click a tool to select it, you can click it again to change its color or thickness.
The tools work better with a pen device, but they can also be used with mouse or touch if you select the Touch Writing button icon.
Use the Eraser tool to remove specific strokes or click it twice to get the option to erase all ink.
Use the ruler or protractor tools and draw straight lines or arches.
Press the ruler/protractor button again to hide the ruler/protractor
Reside or rotate the ruler/protractor by using two finger touch gestures (if the Touch Writing button is selected) or with the mouse wheel.
Use the crop tool to crop the annotated image.
To undo cropping, select the crop tool again and press Cancel to restore the image to its full original area.
Panning the view
Some of the images you annotate might be larger than the size of the Snip & Sketch window. You can use the scroll bars to pan the view, but you can also pan the view with touch input (if the Touch Writing button is not selected) or by dragging with your mouse button while holding the Ctrl key down.
Zoom in and out of screenshots to make them easier to mark up using the magnifying glass icon. You can also zoom in and out of screenshots by pressing the Ctrl key down and tapping the + or — buttons.
Sharing and saving snips
Snip & Sketch copies the annotated snip to your clipboard when you open it and every time you make edits. Snip & Sketch allows you to save the annotated image to a file, share it or open with another app, or print it on paper or to a pdf file.
Using keyboard in Snip & Sketch
While annotating is best done using a pen or mouse — Snip & Sketch provides a lot of keyboard shortcuts you can use. Access keys are activated if you press and hold the Alt key.
New-Windows Image
Captures an image of a drive to a new WIM file.
Syntax
Description
The New-WindowsImage cmdlet captures an image of a drive to a new WIM file. Captured directories include all subfolders and data. You cannot capture an empty directory. A directory must contain at least one file.
This cmdlet does not apply to virtual hard disk (VHD) files.
Examples
Example 1: Capture an image of a drive for a WIM file
This command captures the Drive D image in the WIM file located on d:\ and save to the file c:\imagestore\custom.wim.
Parameters
Specifies the drive or path to the Windows operating system that is to be captured to an image file.
When the path specified is not the root folder of a drive, the captured image will inherit the parent folder security descriptors. If you are capturing an image that was previously applied, apply the original image to the root folder of the drive to ensure that the security descriptors of the new image remain the same.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Detects and tracks .wim file corruption when used with the Add-WindowsImage, Dismount-WindowsImage, or Save-WindowsImage cmdlet. CheckIntegrity stops the operation if DISM detects that the .wim file is corrupted when used with the Expand-WindowsImage or Mount-WindowsImage cmdlet.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the type of compression used for the initial capture operation:
- Max = This option provides the best compression but takes more time to capture the image.
- Fast = This option provides faster image compression but the resulting files are larger than those compressed using the maximum (max) option.
- None = This option does not compress the captured image at all.
The CompressionType parameter does not apply when you export an image to an existing .wim file, you can only use this CompressionType when you export an image to a new .wim file.
Type: | String |
Position: | Named |
Default value: | Fast |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the location of a configuration file that lists exclusions for image capture commands and compress commands. For more information, see DISM Configuration List and WimScript.ini Files in the TechNet Library.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the description of the image to be captured.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the location of a WIM file.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the maximum output level shown in the logs. The default log level is WarningsInfo.
The accepted values are as follows:
- Errors = Errors only
- Warnings = Errors and warnings
- WarningsInfo = Errors, warnings, and information
Type: | LogLevel |
Aliases: | LL |
Accepted values: | Errors, Warnings, WarningsInfo |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the full path and file name to log to. If not set, the default is %WINDIR%\Logs\Dism\dism.log . In Windows PE, the default directory is the RAMDISK scratch space which can be as low as 32 MB. The log file will automatically be archived. The archived log file will be saved with .bak appended to the file name and a new log file will be generated. Each time the log file is archived the .bak file will be overwritten. When using a network share that is not joined to a domain, use the net use command together with domain credentials to set access permissions before you set the log path for the DISM log.
Type: | String |
Aliases: | LP |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the name of an image in a WIM file.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Disables the reparse point tag fix. A reparse point is a file that contains a link to another file on the file system. If the parameter is not specified, reparse points that resolve to paths outside of the value specified by the ImagePath parameter will not be captured.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies a temporary directory that will be used when extracting files for use during servicing. The directory must exist locally. If not specified, the \Windows\%Temp% directory will be used, with a subdirectory name of a randomly generated hexadecimal value for each run of DISM. Items in the scratch directory are deleted after each operation. You should not use a network share location as a scratch directory to expand a package (.cab or .msu file) for installation. The directory used for extracting files for temporary usage during servicing should be a local directory.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Marks a volume image as being a bootable image. This argument is available only for Windows PE images. Only one volume image can be marked as bootable in a .wim file.
Type: | SwitchParameter |
Aliases: | SB |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Checks for errors and file duplication. During an apply operation, for example, using the Add-WindowsImage cmdlet, the size and the hash of the file being applied are checked against the image file to verify they are both equal. During a capture operation, for example, when using the New-WindowsImage cmdlet, after the files is captured into a Windows image, the file is written to a temporary file and compared on a bit-by-bit basis with the original file.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies that the image will be formatted to install on a Windows Image Format Boot (WIMBoot) system.