Mounting and unmounting an ISO image with the command prompt

Discussion in 'Windows 8' started by balubeto, Sep 1, 2014.

  1. balubeto

    balubeto MDL Senior Member

    Dec 22, 2009
    461
    9
    10
    #1 balubeto, Sep 1, 2014
    Last edited: Sep 1, 2014
    Hi

    Using the command prompt (not Powershell) in Windows 8.1 update, how do I mount and unmount an ISO image?

    Thanks

    Bye
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. coleoptere2007

    coleoptere2007 MDL Guru

    Apr 8, 2008
    2,243
    1,157
    90
    You can mount an iso file with explorer by default but can't do any modifications on files.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. CorporateRAT

    CorporateRAT MDL Member

    Aug 4, 2012
    235
    44
    10
  4. Snuffy

    Snuffy MDL Expert

    Jan 7, 2008
    1,184
    592
    60
    I use DISM to mount and unmount

    mount
    DISM /Mount-Wim /WimFile: <wim_file> /Index: <image_number> /MountDir: <mount_directory>

    unmount
    DISM /Unmount-Wim /MountDir: <mount_directory> /Commit
     
  5. s1ave77

    s1ave77 MDL Guide Dog/Dev

    Aug 15, 2012
    14,286
    18,093
    340
    #5 s1ave77, Sep 2, 2014
    Last edited by a moderator: Apr 20, 2017
    Hey Snuffy :D. This is to mount a WIM not an ISO as OP asked for.

    To mount an ISO:

    Code:
    powershell Mount-DiskImage -ImagePath "D:\pathtoyour.iso"
    To un-mount the ISO:

    Code:
    powershell Dismount-DiskImage -ImagePath "D:\pathtoyour.iso"
    To get the driveletter of the mounted ISO the ISOLABEL (mount ISO once to determine the label in properties) can be used:

    Code:
    for /f %%D in ('wmic volume get DriveLetter^, Label ^| find "ISOLABEL"') do set iso=%%D
    Check driveletter with powershell in cmd:

    Code:
    powershell Get-DiskImage -ImagePath "D:\pathtoyour.iso" ^| Get-Volume
    Code:
    Microsoft Windows [Version 6.3.9600]
    (c) 2013 Microsoft Corporation. Alle Rechte vorbehalten.
    
    C:\Windows\System32>powershell Mount-DiskImage -ImagePath "E:\IMAGES\DISC_IMAGES
    \Win.8.1.SE\Acronis2015Beta\Win8.1SE_x64.ISO"
    
    C:\Windows\System32>for /f %D in ('wmic volume get DriveLetter^, Label ^| find "
    Win8.1SE"') do set iso=%D
    
    C:\Windows\System32>set iso=G:
    
    C:\Windows\System32>powershell Get-DiskImage -ImagePath "E:\IMAGES\DISC_IMAGES\W
    in.8.1.SE\Acronis2015Beta\Win8.1SE_x64.ISO" ^| Get-Volume
    
    DriveLetter FileSystemL FileSystem  DriveType  HealthStat SizeRemain       Size
                abel                               us                ing
    ----------- ----------- ----------  ---------  ---------- ----------       ----
    G           Win8.1SE    UDF         CD-ROM     Healthy           0 B    3.51 GB
    
    C:\Windows\System32>powershell Dismount-DiskImage -ImagePath "E:\IMAGES\DISC_IMA
    GES\Win.8.1.SE\Acronis2015Beta\Win8.1SE_x64.ISO"
    
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Snuffy

    Snuffy MDL Expert

    Jan 7, 2008
    1,184
    592
    60
    Your right as RAIN, Thanks for the correction...