Hi Community, 

in this blog I will show you how to mount a .VHD file during boot.

1. create a new .txt and type in: 

select vdisk file=<filepath to vhd>\<vhd name>.vhd #example select vdisk file=d:\Brighteyes_Win7_installation.vhd

attach vdisk

2. create a new .bat file 

diskpart -s "<filepath to .txt file>" #example "d:\scripts\automount_data.txt"

3. copy both files on the same harddrive where the your .vhd are located. If you have .vhd files at different positions, copy them in your windows rootdirectory (subfolders are also ok) 

4. now you have two options to run the script

Option 1: easiest but worstest way

a. create a link to the batchfile in your autostart folder

Option 2: good middleway

a. click right on the computer icon and select manage

b. Open the computer management and go on Task Scheduler

c. click on create task

d. under general please select: 

Name: What ever you think

Discription: Mount VHD file xyz

select -> Run whether user is logged on or not: 

select -> Run with highest priviliges

select -> Configured for Windows 7 and Windows 2008 R2 

e. go on Triggers and klick new

f. select Trigger at startup and klick ok 

g. go on conditions and remove all marks from the checkboxes

 

h. go on settings and change following options

select -> allow task to be run on demand

select -> Run task as soon as possible after a scheduled task is missed

select -> after the task failed, restart every: 1 minute

select -> Attempt to restart up to: 3 times

select -> stop the task if it runs longer than: 1 houre

select -> ih the running task does not end when requested force it to stop

i. klick ok 

j. restart your OS and check if the HD is mounted

It is also possible to mount VHDs with local or group policy's. I will explain this in one of my next blogposts.