Skip Links

Network World

Glenn Weadock

Alternative to VHDMOUNT: Final Thoughts

By Glenn Weadock on Tue, 09/02/08 - 2:19pm.

A few days ago, I wrote about what seemed to be an elegant solution to the problem of mounting VHD files within Server 2008 without installing IIS and Virtual Server 2005. Ravi Chaganti came up with a combo VBS and REG file that added the nifty "Mount" and "Dismount" commands to a VHD file. However, mounting a VHD didn't actually bring it online. You could do that in Disk Management, but I was looking for a more automated solution.

And Ravi supplied it, here: http://www.ravichaganti.com/blog/?p=116. This is a batch file that invokes the DISKPART utility, first to figure out the number of the disk that's offline, then to select it and bring it online.

In order to make this script work on Server 2008's version of DISKPART, I had to make two edits to Ravi's script. First, in the FOR loop on line 15, change the capitalization from "offline" to "Offline". Second, in line 23, change "online" to "online disk", so that the full line reads as follows:

echo online disk >> %temp%\vhdonline.dps

When you're done, you can test the batch file separately. Then you can invoke it daisy-chain style from VHDMOUNT.VBS using the WshShell.Run method, as Ravi suggests. Sweet!

Recent Posts:

Adventures in Benchmarking

Hyper-V Manager and Helpless Help

Hyper-V Manager on Vista – final thoughts

What is Tech Briefcase?
TechBriefcase is a new, free service where IT Professionals can Search, Store and Share IT white papers and content like this. Learn more
Bookmark content
Speed up your research efforts with content across the web.
Search and Store
Find the white papers you need. Create folders for any topic.
View Anywhere
Open your briefcase on your iPhone, tablet or desktop. Share with colleagues.
Don't have an account yet?
About Glenn Weadock on Windows Server 2008

Glenn Weadock is a longtime instructor for Global Knowledge and teaches Windows 7, Server 2008, and Active Directory. He has recently co-developed with Mark Wilkins two advanced Server 2008 classes in the Microsoft Official Curriculum. Glenn also consults through his Colorado-based company Independent Software, Inc. and is technical director of MarketCoach Investment Education Software LLC.

Global Knowledge

 

Most Discussed Posts