Attach Virtual Hard Disk Automatically At Windows Startup

by Prashant 11. August 2010 03:03

Windows 7 gives you the power to create Virtual Hard Disk (VHD). If you don't know how to create a VHD in Windows 7 then you seriously need to learn how to unleash Windows 7 power. You can see the links in the end which will let you create a new VHD on your Windows 7 machine and there are some other recommended links.

I assume that you know or you have created a new VHD and attached or mount on your Windows 7 machine. But this is one time fun.....Once you reboot or logoff the attached VHD is gone. Now you need to follow all those steps again to attach the VHD, not this time but every time you logoff or restart. To get relief from this pain perform the following steps.

Open notepad and add the below command to the file:

Select vdisk file=”D:\SourceSafe.vhd”
Attach vdisk

Now save the file with the name of your choice with “.s” as its extension. Open notepad again and add the following line of code to get your VHD attached at system startup and save this file with file extension as ".bat"

DISKPART –s  "Path of the <.s file> created in the above step"

The path name should be the fully qualified name of the “.s” file. Just in case you face any problem I have attached the files I am using to mount my SourceSafe VHD at system startup. Place the ".bat" in the startup folder and thats it. Next time you logoff or restart you VHD gets attached automatically.

Download: AttachVHD.zip (313.00 bytes)

 Related Links:

If you enjoyed this post, make sure you subscribe to my RSS feed!

Tags: ,

Windows 7

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading


Visit blogadda.com to discover Indian blogs Computers Blogs

About Me

Name of authorPrashant Khandelwal.
Programmer and tech enthusiast. More...

Feeds Subscribe Twitter Facebook Google Plus Linked In Delicious

My Visual Studio Achievements

Badges

Month List

Blog Stats

321,879 Hits

Adverts

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012

Creative Commons License