Hi Using the command prompt (not Powershell) in Windows 8.1 update, how do I mount and unmount an ISO image? Thanks Bye
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
Hey Snuffy . 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"
i know im 7(!!!) yrs late but incase anybody wants the real answer to this question... its "no" i looked in2 wmic but afaict it cant spawn non-persistent object instances BUT heres 5 lines (real lines - the 1s that start with ' are coments) of vbscript that will do it 4u Code: ' this is exactly how the Mount-Diskimage PS cmdlet works internally BTW With GetObject("WinMgmtS:\\.\ROOT\Microsoft\Windows\Storage").Get("MSFT_DiskImage").SpawnInstance_() ' -ImagePath must be a full path .ImagePath = "C:\Users\User\Download\en-us_windows_server_version_2022_updated_october_2021_x64_dvd_b6e25591.iso" ' -StorageType switch: 0 for "unknown" (virtdisk.dll will guess), 1 for iso, 2 for vhd, 3 for vhdx .StorageType = 0 ' the first parameter is -Access: 0 for unknown, 2 for read-write, 3 for read-only ' the second is -NoDriveLetter: false to assign a letter, true to attach imae but not give it a drive letter .Mount 3, False End With 2 unmount, change Code: .Mount 3, False to Code: .Dismount (Dismount method takes no parameters) edit: works in winpe/winre if u have the WinPE-StorageWMI package installed too its installed by default since 2013 but earlier versions (and "naked" pe from the adk) will need it dism /add-package'd