2

I am using OpenVirtualDisk and AttachVirtualDisk functions to mount VHD files, but I couldn't find how to specify a drive letter while mounting the vhd file.

I would like to specify the drive letter for e.g (G:, H:, K: etc) to mount.

Can anyone please help?

Deanna
  • 23,876
  • 7
  • 71
  • 156
Marc Spencer
  • 357
  • 1
  • 3
  • 12

1 Answers1

0

Haven't tried it myself, but probably by attaching it without a drive letter first (see flags) and then calling SetVolumeMountPoint or DefineDosDevice yourself. Both allow you to pass in the desired drive letter. (Which of course carries a race condition. Even if you thought the drive letter was free, it may not be once you call SetVolumeMountPoint)

MSalters
  • 173,980
  • 10
  • 155
  • 350