Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: How TO persistantly MOUNT VHD at BOOT TIME

26 Jul 2009   #1

Windows 7 64-bit 7600 OEM
How TO persistantly MOUNT VHD at BOOT TIME

I have multiple VHD data Drives.. After attatching them in win7 every time i reboot they are gone and i have to Re-Attach them again.....

It seems a bit silly Why would microsoft do this... Hmmm..


My System SpecsSystem Spec
29 Jul 2009   #2

Windows 7 64-bit 7600 OEM

Ok I forgot about this posting... SORRY!

diskpart /s c:\scripts\drives.txt

we create a file called AttachPersistantDrives.CMD with the above text and create a shortcut in the start folder in the menu of your user.

then we create a script.TXT file to contain the list of disks to be added

select vdisk file="z:\storage\Application Library.vhd"
attach vdisk

select vdisk file="z:\storage\Music Library.vhd"
attach vdisk

select vdisk file="z:\storage\video library.vhd"
attach vdisk

I found that there was a lot of boxes coming up on screen, SO. I edit Local Security policy.

And Made Minor changes to User Acount Control. As We DONT WANT TO TURN OFF THIS FEATURE.... I have Exported the security poilcy to a VhdSecpolicy.INF to imported For ease later.

User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode - YES ELEVATE

User Account Control: Turn on Admin Approval Mode -YES

User Account Control: Switch to the secure desktop when prompting for elevation - disable (personal)

Now when i logon All My Vhds Logon TOO. In their specified order AND able to be added to Libraries... <my drives always get the same Letters Now. although i should be using folder mounts instead> If I am Not logged on then My Librarys are unavailable!<my drive are not attached>

So You Can And Should Manage files better and even Protect Files From Evil Antivirus softwares with Hidden agendas to delete "SPECIFIC SOFTWARE" from your pc,even when NOT VIRUSED UP!... also easier to Scan whole system as not so much files unless all the Vhd's are attached...
My System SpecsSystem Spec
05 Oct 2010   #3

Windows 7 Home Premium x64


I've tried your advice on both Windows 7 x64 Home Premium and Professional and it's not working. All I am receiving is "DiskPart has encountered an error: The system cannot find the path specified. See the System Event Log for more information."

The VHD I'm trying to attach is on an external harddrive connected to my router. The only way I can attach it right now is through the disk management GUI. The command prompt version doesn't work at all.

EDIT: For remote drives you need to give a UNC path and not a mapped drive e.g. \\COMPUTER\backup.vhd.
My System SpecsSystem Spec

17 Oct 2015   #4

Windows 7 Ultimate 64bit

sorry for hijacking but figured y'all might be in the know...

My experience is that Josip Medved's VHD Attach is the quickest method I've found so far.

After re-reviewing comments in How to Create Scheduled Task to attach volume, it seems that the Administrators group required permissions advice given is incorrect, but that 'System' will work.

When I use the batch method I can stamp a log

echo %date% %time% startedScript >> D:\log.txt
diskpart /s "D:\vhd\attachLBS.txt" >> D:\log.txt
ECHO. >> D:\log.txt
echo %date% %time% finishedScript >> D:\log.txt
17/10/2015  0:25:11.55 startedScript 

Microsoft DiskPart version 6.1.7600
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: DELHIBOY

DiskPart successfully selected the virtual disk file.

  100 percent completed

DiskPart successfully attached the virtual disk file.
17/10/2015  0:25:31.66 finishedScript
I'm looking at VHD Attach, and wondering a) if there's a log that shows when a volume was mounted (or if that can be inferred), to compare with when the VHD Attach svc starts (& what else happens @ boot>startup>loginscreen>login)

Any way of identifying WHEN a volume was mounted?
My System SpecsSystem Spec

 How TO persistantly MOUNT VHD at BOOT TIME

Thread Tools

Similar help and support threads
Thread Forum
Hard drive won't boot up or mount
So I'm trying to see if I can recover any files from this hard drive, but not having much luck. Have tried tools like TestDisk and linux command lines. Some more info: ? View topic - Can't write to partition Can anyone offer any suggestions?
Hardware & Devices
Hard Drive Doesn't Mount Its self on Boot
Hi all, Suddenly got a strange problem with my Hard drive, it's a seagate 500gb, suddenly whenever i boot to my OS, my second hard drive isn't mounting its self a drive letter, so therefore i can't see it in 'my computer', but then if i go to disk management, assign it a letter like Local Disk...
Hardware & Devices
Dual boot (7&Linux), hibernation, unmount/mount HDD storage partition?
I set up a netbook dual boot to Win 7 Starter or Lubuntu. It would be convenient to hibernate one OS when switching to the other. I made a partition on the hard drive for data storage and transfer between the two OS'. I need to unmount that partition before hibernating. That's easily done in...
General Discussion
Extra Windows 7 Boot option makes pc take more time to boot up.
So yeah, my simple issue is thaht i installed windows 7 on a hard drive, which i later replaced with a Samsung 840 SSD, which also was bootable. So now ive got 2 windows 7 options to boot from, and the only bad thing there is is that it takes 30 extra seconds to boot up, which isnt that much of an...
Installation & Setup
Boot mount volume blue screen with other errors
Hi guys I have these problems with my dell xps m1330 and I also can't boot into safe mode, what do I do? Also when I try to reinstall windows from USB it loads a black screen with movable mouse.
BSOD Help and Support

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 18:17.
Twitter Facebook Google+