다음을 통해 공유


Oscdimg Command-Line Options

Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2

Oscdimg is a command-line tool that you can use to create an image (.iso) file of a customized 32-bit or 64-bit version of Windows Preinstallation Environment (Windows PE). You can then burn the .iso file to a CD or DVD. Oscdimg supports ISO 9660, Joliet, and Universal Disk Format (UDF) file systems.

In this topic:

  • File System Options

  • CD or DVD Boot Options

  • Optimization Options

  • Order Options

  • DVD Video and Audio Options

  • Messaging Options

  • General Image Creation Options

  • Examples

Oscdimg Command-Line Options

The following command-line options are available for Oscdimg.

Oscdimg [<options>] <sourceLocation><destinationFile>

File System Options

The Oscdimg tool and Microsoft Windows image mastering API (IMAPI) support three file system formats: ISO 9660, Joliet, and UDF.

ISO 9660 Options

ISO 9660 options cannot be combined with Joliet or UDF options. The length of the file name combined with the length of the file name extension cannot exceed 30 characters in the ISO 9660 file system.

The -d and -nt options cannot be used together.

Option Description

-d

Permits lower case file names. Does not force lowercase file names to upper case.

-n

Permits file names longer than DOS 8.3 file names.

-nt

Permits long file names that are compatible with Windows NT 3.51.

Joliet Options

Joliet is an extension of the ISO 9660 file system. Joliet allows longer file names, Unicode characters, and directory depths larger than eight. Joliet options cannot be combined with ISO 9660 options.

The -j2 Joliet option cannot be used with any UDF options.

Option Description

-j1

Permits both file systems to view all the data on the disk. Using this option does not duplicate all files on the image. This option encodes Joliet Unicode file names and generates DOS-compatible 8.3 file names in the ISO 9660 namespace. These file names can be read by either Joliet systems or conventional ISO 9660 systems. However, Oscdimg may change some of the file names in the ISO 9660 namespace to comply with DOS 8.3 and ISO 9660 naming restrictions.

-j2

Encodes Joliet Unicode file names without standard ISO 9660 names. This option is used to produce an image that contains only the Joliet file system.  Any system that cannot read Joliet sees only a default text file that alerts the user that this image is only available on computers that support Joliet.

-js

Overrides the default text file that is used when the user specifies the -j2 option. For example:

-jsC:\readme.txt

UDF Options

UDF options cannot be combined with ISO 9660 options. The -ue, -uf, and -us options only apply when they are used together with the -u2 option.

Option Description

-u1

Produces an image that has both the UDF file system and the ISO 9660 file system. The ISO 9660 file system is written by using DOS-compatible 8.3 file names. The UDF file system is written by using Unicode file names.

-u2

Produces an image that contains only the UDF file system. Any system that cannot read UDF sees only a default text file that alerts the user that this image is only available on computers that support UDF.

-udfver102

Specifies UDF file system version 1.02.

-ue

Creates embedded files.

-uf

Embeds UDF file identifier entries.

-ur

Overrides the default text file that is used together with the -u2 option. For example:

-urC:\Readme.txt

-us

Creates sparse files, when available, to make disk space usage more efficient.

-yl

Specifies long allocation descriptors instead of short allocation descriptors.

CD or DVD Boot Options

Boot options can be used to create bootable CD or DVD images. The following boot options can be used to generate single-boot entries. For more information, see Use a single-boot entry to create a bootable image.

Option Description

-b<bootSectorFile>

Specifies the El Torito boot sector file that will be written in the boot sector or sectors of the disk. Do not use spaces. For example:

On UEFI: -bC:\winpe_x86\Efisys.bin

On BIOS: -bC:\winpe_x86\Etfsboot.com

-e

Disables floppy disk emulation in the El Torito catalog.

-p

Specifies the value to use for the platform ID in the El Torito catalog. The default ID is 0xEF to represent a Unified Extensible Firmware Interface (UEFI) system. 0x00 represents a BIOS system.

<sourceLocation>

Required. Specifies the location of the files that you intend to build into an .iso image.

<targetFile>

Specifies the name of the .iso image file.

Important

Single-boot entries and multi-boot entries cannot be combined in the same command.

The following boot options can be used to generate multi-boot entries. For more information, see Use multi-boot entries to create a bootable image.

Option Description

b<bootSectorFile>

Specifies the El Torito boot sector file that will be written in the boot sector or sectors of the disk. Do not use spaces. For example:

On UEFI: bEfisys.bin

On BIOS: bEtfsboot.com

-bootdata:<number>

Specifies a multi-boot image, followed by the number of boot entries. Do not use spaces. For example:

-bootdata:<3>#<defaultBootEntry>#<bootEntry1>#<bootEntryN>

where <3> is the number of boot entries that follow.

e

Disables floppy disk emulation in the El Torito catalog.

p

Specifies the value to use for the platform ID in the El Torito catalog. The default ID is 0xEF to represent a UEFI system. 0x00 represents a BIOS system.

t

Specifies the El Torito load segment. If not specified, this option defaults to 0x7C0.

<sourceLocation>

Required. Specifies the location of the files that you intend to build into an .iso image.

<targetFile>

Specifies the name of the .iso image file.

Optimization Options

Optimization options can be used to optimize storage by encoding duplicate files only once.

Option Description

-o

Uses a MD5 hashing algorithm to compare files.

-oc

Uses a binary comparison of each file, and is slower than the -o option.

-oi

Ignores Diamond compression timestamps when comparing files.

Order Options

Order options specify the file order on disk. The file order does not have to list all files. Any files that do not appear in this file are ordered as they would be ordinarily (that is, if the ordering file did not exist). For more information, see Specify the boot order.

The -yo option takes precedence over the -y5 option.

Option Description

-y5

Specifies file layout on disk. This option writes all files in an i386 directory first and in reverse sort order.

-yo<bootOrder.txt>

Specifies a text file that has a layout for the files to be put in the image. Do not use spaces. For example:

-yoC:\temp\bootOrder.txt

DVD Video and Audio Options

The DVD video and audio disk creation options cannot be combined with ISO 9660, Joliet, or UDF options.

Option Description

-ut

Truncates the ISO 9660 section of the image during DVD video and audio disk creation. When this option is used, only the VIDEO_TS, AUDIO_TS, and JACKET_P directories are visible from the ISO 9660 file system.

-uv

Specifies UDF Video Zone compatibility during DVD video and audio disk creation. During creation, UDF 1.02 and ISO 9660 are written to the disk. All files in the VIDEO_TS, AUDIO_TS, and JACKET_P directories are written first. These directories take precedence over all other ordering rules that are used for this image.

Messaging Options

Messaging options customize how file and directory information appears.

Option Description

-a

Displays the allocation summary for files and directories.

-os

Shows duplicate files when the system creates the image.

-w1

Reports all file names or directories that are not ISO-compliant or Joliet-compliant.

-w2

Reports all file names that are not DOS-compliant.

-w3

Reports all zero-length files.

-w4

Reports each file name that is copied to the image.

-yd

Suppresses warnings for non-identical files that have the same initial 64,000 bytes.

General Image Creation Options

General image creation options can be used together with a single-boot entry option or multi-boot entry options to create bootable CD or DVD images. For more information, see CD or DVD Boot Options and Examples.

The -m and -maxsize options cannot be used together.

Option Description

-c

Specifies that the system must use ANSI file names instead of OEM file names.

-g

Encodes time values as Universal Coordinated Time (UCT) for all files, instead of the local time.

-h

Includes hidden files and directories in the source path of the image.

-k

Creates an image even if some of the source files cannot be opened.

-l<volumeLabel>

Specifies the volume label. Do not use spaces. For example:

-l<volumeLabel>

-m

Ignores the maximum size limit of an image.

-maxsize:<limit>

Overrides the default maximum size of an image. The default value is a 74-minute CD. However, if UDF is used, the default has no maximum size. Do not use spaces. For example:

-maxsize:<4096>

where <4096> limits the image to 4096 MB.

-q

Scans the source files only. This option does not create an image.

-r

New for Windows® 8. Resolves symbolic links to their target location.

-t<mm/dd/yyyy,hh:mm:ss>

Specifies the timestamp for all files and directories. Do not use spaces. You can use any delimiter between the items. For example:

-t12/31/2000,15:01:00

-y6

Specifies that directory records must be exactly aligned at the end of sectors.

-yw

Opens source files that have write sharing.

Examples

These examples illustrate how to do the following:

  • Create a bootable CD or DVD for a UEFI-based computer by using a single-boot entry.

  • Create a bootable CD or DVD for a UEFI-based or BIOS-based computer by using a multi-boot entry.

  • Specify the boot file order on a disk.

Use a single-boot entry to create a bootable image

You can use the Oscdimg tool to create a bootable CD or DVD by using a single-boot entry.

To use a single-boot entry

  • Create an image file for a UEFI-based computer. For example:

    Oscdimg -bC:\winpe_amd64\Efisys.bin -pEF -u1 -udfver102 C:\winpe_amd64\media C:\winpe_amd64\winpeamd64.iso
    

    where C:\winpe_amd64\media is the location of the source files, and C:\winpe_amd64\winpeamd64.iso is the path of the .iso file.

Use multi-boot entries to create a bootable image

You can use the Oscdimg tool to create a bootable CD or DVD by using multi-boot entries. When you do this, note the following:

  • The bootdata option must be followed by the number of boot entries in the command (-bootdata:<number>).

  • Each multi-boot entry must be delimited by using a hash symbol (#).

  • Each option for a boot entry must be delimited by using a comma (,).

  • Each boot entry must specify the platform ID.

To use multi-boot entries

  • Create an image file for either a UEFI-based or BIOS-based computer by using a multi-boot command. For example:

    Oscdimg -bootdata:2#p0,e,bEtfsboot.com#pEF,e,bEfisys.bin -u1 
    -udfver102 C:\winpe_amd64\media C:\winpe_amd64\winpeamd64.iso
    

    where this command starts the Etfsboot.com boot file for a BIOS image, and then starts the Efisys.bin boot file for a UEFI image.

Specify the boot order

For images larger than 4.5 GB, you must create a boot order file to make sure that boot files are located at the beginning of the image.

The rules for file ordering are as follows:

  • The order file must be in ANSI.

  • The order file must end in a new line.

  • The order file must have one file per line.

  • Each file must be specified relative to the root of the image.

  • Each file must be specified as a long file name. No short names are allowed.

  • Each file path cannot be longer than MAX_PATH. This includes the volume name.

For example, D:\cdimage would resemble the following (where D is the drive letter of the DVD drive):

  • D:\cdimage\1\1.txt

  • D:\cdimage\2\2.txt

  • D:\cdimage\3\3.txt

  • D:\cdimage\3\3_5.txt

  • D:\cdimage\<longFileName>.txt

To create a boot order file

  • Create a boot order file. For example:

    Oscdimg -m -n -yoC:\temp\bootOrder.txt 
    -bC:\winpe_amd64\Efisys.bin C:\winpe_amd64\winpeamd64.iso
    

    where BootOrder.txt contains the following list of files:

    boot\bcd
    boot\boot.sdi
    boot\bootfix.bin
    boot\bootsect.exe
    boot\etfsboot.com
    boot\memtest.efi
    boot\memtest.exe
    boot\en-us\bootsect.exe.mui
    boot\fonts\chs_boot.ttf
    boot\fonts\cht_boot.ttf
    boot\fonts\jpn_boot.ttf
    boot\fonts\kor_boot.ttf
    boot\fonts\wgl4_boot.ttf
    sources\boot.wim
    

See Also

Tasks

WinPE: Create USB Bootable drive

Other Resources

Windows Deployment Command-Line Tools Reference