views:

57

answers:

0

Here is my situation. I boot Windows PE (WinPE 3.0 from Win AIK, basically stripped down Windows 7) from CD with automounting disabled via the registry.

I then connect a usb thumb drive. I run diskpart.exe to bring the disk "online" so I can write files to it. My steps are:

diskpart.exe (version is 6.1.7600)

  • DISKPART> select disk 1
  • DISKPART> online disk

DiskPart successfully onlined the selected disk.

This works if I have a newly formatted USB drive. If it is not newly formatted, it will result in this:

  • DISKPART> select disk 1
  • DISKPART> online disk

Virtual Disk Service error: The object is not found.

I wrote C++ COM code that uses VDS to accomplish the same thing (using SetSanMode = true) and I get the same results: Either it works fine the first time or if I reboot and try to bring the same usb key online, I get 0x80042405 VDS_E_OBJECT_NOT_FOUND.

There isn't much documentation on why I would get this error. It lists the usb drive when I say list disk. Is there some GUID or something being written to my thumb drive that will prevent it from being mounted multiple times using this method?

Here's another data point: after successfully bringing the disk online, if I have the usb drive inserted throughout the reboot and then try to bring it online again, it works. If I shutdown the system, take the thumb drive out, then boot up, then plug in the usb drive and try to bring it online, I get the same error about object not found. So there must be something that gets registered or altered on the thumb drive during boot.

I have tried many, many times and have formatted with both FAT32 and NTFS to start the process. I have tried both VMWare and Hardware targets. I could really use some help here.

Thanks.