How To Create ISO From Folder Using Command Line In Windows

Optical Disk Image (ISO) files are very commonly used amongst Windows users since the Windows operating system natively supports this file format. You can open and mount an ISO file on a Windows PC without using third-party software. However, you can have difficulty creating an ISO file from a folder or a WIM file.

This post shows you how to create a bootable ISO image from a folder using just the Windows Command Line Interface (CLI). The method discussed in this post eliminates the use of third-party software, which is why no paid software is needed, nor do you have to watch any advertisements that accompany a free tool.

You can apply this method to create a .ISO file on the Windows command line if:

  • You have made changes to an existing ISO file after extracting it and want to recreate a modified ISO image.
  • You want to share multiple files after converting them into a single, compressed file.
  • You want to create a bootable ISO image.

Let us move on to see how to create an ISO image from a simple folder on a Windows PC.

Although third-party software is not needed for the process, you must still install Microsoft Windows Assessment and Deployment Kit (ADK), formerly known as Windows Automated Installation Kit (Windows AIK). Windows ADK is a collection of tools that you can combine to prepare, assess and launch image-based large-scale Windows deployments.

One of the Windows ADK components is the “Deployment tools,” which contains the OSCDIMG tool. The OSCDIMG is a command-line tool that you can use to create a custom ISO image of any folder using the Command Prompt.

That said, we have divided this guide into 2 steps:

  1. Installing Windows ADK’s Deployment Tools component.
  2. Creating an ISO file from a folder.

These steps need to be performed in the chronological order mentioned since we will be using the OSCDIMG tool to create an ISO.

Install Windows ADK

Perform the following steps to install Windows ADK Deployment Tools:

  1. Start by downloading the Windows ADK installation package suited for your operating system from our Windows ADK guidepost.

  2. Execute the downloaded package and the installation wizard should then run. We suggest that you leave the default location and click Next.

    Select installation path
    Select installation path
  3. Click Next on the next screen again.

    Click Next 1
    Click Next
  4. Accept the license agreement.

    Accept license agreement
    Accept license agreement
  5. On the next screen, select “Deployment Tools” whilst unchecking all other boxes, and then click Install.

    Select and install
    Select and install
  6. Windows ADK will now install. Once it is finished, click Close.

    Close wizard
    Close wizard

Windows ADK Deployment tools should now be available on your PC. Continue to learn how to use OSCDIMG to create an ISO image from a folder.

Create ISO File From Windows Command Line

Now follow these steps to create an ISO image using Window Command Prompt:

  1. Before you begin, create a standard folder using File Explorer containing the contents you want in the ISO image.

  2. Now open Command Prompt with elevated privileges.

  3. Now use the following cmdlet to change the directory to the folder where the OSCDIMG file has been installed. Replace Path with the complete path to the OSCDIMG file.

    cd /d Path

    The default installation path for the OSCDIMG file is the following:

    C:\Program Files (x86)\Windows Kits\<version>\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg

    Using this cmdlet and information, we changed the directory with the cmdlet in the following image:

    Change directory
    Change directory
  4. Once you are inside the directory with the OSCDIMG file, use the following cmdlet to create an ISO image of a folder:

    Replace PathToSource with the complete path to the folder you want to convert to an ISO image and DestinationPath to the location where you want to save the generated ISO file.

    OSCDIMG -n -d -m PathToSource DestinationPath.ISO
    ISO image created
    ISO image created

You can now find the newly created ISO file at the designated location provided in step 4 above. If the contents inside the source folder were bootable, you can now use this ISO image to create a bootable drive and then use it.

Closing Words

The internet is filled with other command-line tools and GUI-based tools that can be used to create an ISO image file. However, we used the OSCDIMG tool because it has been created by Microsoft, therefore it is reliable and free to use.

We hope that this post enabled you to create ISO images quickly and efficiently without using third-party software.

If you liked this post, Share it on:
Subhan Zafar is an established IT professional with interests in Windows and Server infrastructure testing and research, and is currently working with Itechtics as a research consultant. He has studied Electrical Engineering and is also certified by Huawei (HCNA & HCNP Routing and Switching).

Leave the first comment

Get Updates in Your Inbox

Sign up for the regular updates and be the first to know about the latest tech information