How to Create and Permanently Attach a Virtual Hard Disk in Windows 7

Punniya seelan
2

Create Virtual Hard Disk (VHD)

You can create a virtual hard disk from Computer Management wizard.
Right-click on My Computer and select “Manage”.
or, type compmgmt.msc at the Windows 7 start menu search box and hit Enter. The Computer Management wizard will appear. Now follow the steps below.
Right-click on “Disk Management” under “Storage” and click on “Create VHD”.
In the next wizard select the location and the VHD file name by clicking on “Browse”, put the size of the virtual hard disk in MB and click on OK.
This will create the Virtual Hard Disk with the level Disk 1.
Now right-click on Disk 1 and select initialize then click “Next”.
After initializing the disk, you have to allocate the disk space. So right-click on the unallocated space and select “New Simple Volume”.
In “New Simple Volume” wizard put the volume size and click on “Next”.
Assign a drive letter for the drive by choosing from the drop down list of available letters.Click on “Next”.
Before formatting the volume, choose the file system, give a volume level and click on“Next” then “Finish”.
You are done! You cannotice that your new virtual hard disk has been listed with the other disk drives.

Attach an existing Virtual Hard Disk

Right click on My Computer icon then select “Manage” to open Computer Management wizard. Now under the “Storage” entry, right-click on “Disk management”. Select “Attach VHD” and locate the existing vhd file and click on OK. That’s all.
So after creating a new Virtual Hard drive or attaching an existing one, you can access it from the Windows 7 explorer window.
But the problem is that every time you restart your computer, you lost the virtual drive and you’ll have to reattach the VHD again. There is a simple tricks by which you can make the virtual drive permanent and you won’t have to reattach that after every time you start your computer.

Permanently attach Virtual Hard Disk in Windows 7

To make the virtual hard disk permanent, create a batch file to attach the VHD and run that at start up by creating a registry entry. Here is the complete procedure.
Creating the batch file
Copy the following code and paste in a notepad document.
@echo off
SET TEMPFILE="%TEMP%%RANDOM%.TXT"
echo SELECT VDISK FILE=Your vhd file name with location >%TEMPFILE%
echo ATTACH VDISK>>%TEMPFILE%
DISKPART /s %TEMPFILE%
del %TEMPFILE%
Replace the high lighted part with the vhd file name along with location. As for example E:myvirtualdrive.vhd
Now save the file as some_name.bat. Also change the “Save as type” to “All files” before saving. After creating the batch file copy the file (some_name.bat) and paste at C: > Windows > System 32 folder. When pasting the file there you will get a security message. Just click on “Continue”.
Creating the registry entry
Press Win key + R and type “regedit” and hit Enter to open the registry editor. Now navigate to the following path from the left pane of the editor:
HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > Windows > CurrentVersion > Run
Now create a new string value under “Run”. Right-click on the empty space of the right pane and select New > String Value.
Give a name of the value. Here it is VHD. Now right click on the value VHD and select“Modify”.
At the Value data field put “c:windowssystem32some_name.bat” and click OK.
Restart your computer. You cannotice the virtual drive that you created or attached has been permanently occupied in the explorer or any other places.

Post a Comment

2Comments

  1. What happens if you try the trick when the VHD/VHDX is formatted as "Dynamically expanding?"

    ReplyDelete
  2. It is very kind of you have posted this information thank you, please contact me if you if you would like to open a tshirt store , a shoe store, become airplane broker are interested in buying 12 horsses and one bull, advertising on the internet news Baja Noticias Digial con periodista Felix MIllan Torrecias, would like some renderforest.com creations, or some promo videos, powtoons, some drone filming, or would lie to collaberate on ad copy to subit to the CliO AWARDS. Also if you are interested in applying for a grant for television. In selfpublishing you own novel a story in paperback, in dvd, in audio, or can write code for android, the next trick this question is can this be emmulated onto lg stylo 4 and get the android system to open the files them and keep them secured from expanding to the root level, the idea is to now get viboot and windows 8 , windows 9, windows 10, pro versions to install and operate independantly without rebooting, and squee\ing them into a single rar and up up and away.Portable my work space, oh also recreating the virtual disk to become inside the space virtual memeory. The computer that is runing it now, before this configuration that I decided would remain permanent uses all four disks as virtual memory the computer is screaming fast. when it was very troubled having only 2 gb of ram its now running on well 4 tb and um 500 gb on two other drives, plus the original 2 gb ram. iuts fast and Im happy. This is a pretty decent thank from Gabriel Solares Martinez

    ReplyDelete
Post a Comment