3

I want to mount a WIM image as a new drive letter on Windows 10.

As follows from Microsoft documentation for DISM Image Management Command-Line Options, DISM can only mount a WIM image to an existing directory. Powershell Mount-DiskImage can only do what I want with VHD or ISO images (no mention of WIM in the docs).

The question: What is a practical way of having my .wim-file content attached to a drive letter (say, z:) that is not in use for anything else?

The main reason I want to do this is convenience of browsing the content. I made a WIM image to backup what used to be z:, now I need to access it, preferably as z:. Also, I noticed that opening WIM image using 7zip is much faster than mounting it to an existing file system. So I hope treating WIM as a separate logical drive will avoid this costly overhead.

I would appreciate the answer to my question, as well as any comments that correct any misunderdestanding of mine (such as whether WIM is a really bad choice for a backup).

Update 1. (responding to Ramhound's comment) I tried

dism /Mount-Wim /WimFile:c:\foo.wim /Index:1 /MountDir:z:

The error message is:

The user attempted to mount to a directory that does not exist. This is not supported.
paperskilltrees
  • 141
  • 1
  • 6
  • What have you tried? You should edit your question instead of submitting a comment. This seems like a simple problem to solve, create an ISO file, that contains the .WIM image. You can then mount the .WIM image, of course, that does indeed need the storage space to do so. – Ramhound May 08 '20 at 17:03
  • The difference between mounting a WIM file and opening in 7Zip is that a mounted WIM image can be modified where as 7Zip just allows to extract files from the WIM. – Robert May 08 '20 at 18:16
  • @Robert Thanks, noted. Just to clarify: I mounted WIM using DISM with a /ReadOnly flag. I guess, DISM does not do any optimisation or shortcuts in the read-only mode. – paperskilltrees May 08 '20 at 19:09
  • @Ramhound I updated the question, and thanks for the hint. I have not tried creating an ISO file from WIM image. I am researching it now. Is [this](https://www.tenforums.com/tutorials/133098-dism-create-bootable-iso-multiple-windows-10-images.html) what you are suggesting? – paperskilltrees May 08 '20 at 19:20
  • https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/mount-and-modify-a-windows-image-using-dism – Moab May 08 '20 at 19:29
  • @Moab `/optimize` option works and reduces mount time, thanks! However, the main question still stands. – paperskilltrees May 08 '20 at 19:51

1 Answers1

2

There is an old trick that dates back to DOS epoch, when The Windows had not existed yet, but still supported:

SUBST [drive1: [drive2:]path]

e.g.

C:\> Dism /mount-Image /ImageFile:c:\foo.wim /index:1 /mountdir:C:\mnt\wim1 /readonly /optimize
C:\> subst Z: c:\mnt\wim1

This operation is not privileged, and, contrast to "normal" mounts, this substitution exists only within your current windows session, hence invisible to other users and discarded on logoff.

jabba
  • 21
  • 3