1

I have some virtual hard disks mounted on my company's web server, but any time I have to reboot it to install Windows Updates, I have to manually reattach the VHDs. I'm guessing there's no built-in way to tell the OS to persist VHD attachments across reboots, so is there a command line interface I can use to create a batch script that will reattach them on reboot? Or what is the best solution to this issue?

Jake Petroules
  • 251
  • 3
  • 11

3 Answers3

1

diskpart is the command-line interface for managing VHDs (along with many other facets of the Windows disk subsystem).

For your specific question, put these lines in a file:

select vdisk file=<full path to VHD>
attach vdisk

and then run it with type <filename> | diskpart.

That said, there may well be a way to persist these connections, but I don't know of one.

Handyman5
  • 5,257
  • 26
  • 30
0

maybe diskparts automount enable command.

tony roth
  • 3,884
  • 18
  • 14
0

Follow the directions here

Basically you are creating a diskpart script and then linking the script to a scheduled task that runs on system startup.

Joe
  • 1,170
  • 1
  • 8
  • 12