Network World
Saturday, November 22, 2008
DNSstuff.com
Get information about your IP
IP Information
50+ On-demand DNS and network tools

Glenn Weadock on Windows Server 2008

Microsoft Subnet

Navigation

Alternative to VHDMOUNT: Final Thoughts

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

VHDMOUNT Script Updates

Useful answer?
0

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <i> <b> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <br /> <br> <p>
  • Lines and paragraphs break automatically.
  • You can use BBCode tags in the text.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

About Glenn Weadock

Glenn Weadock is currently an instructor with Global Knowledge, teaching various Microsoft training courses such as MCSA, MCSE, Server 2008 and Vista tracks.

RSS feed

Weadock's archive.

Global Knowledge offers a comprehensive catalog of Microsoft courses:
Microsoft 2003 MCSA Boot Camp
Microsoft 2003 MCSE Boot Camp
MCITP: Server 2008 Combo Boot Camp
Migrating to Server 2008
Managing and Maintaining Server 2008
More Microsoft Courses

Microsoft Subnet

RSS feed Microsoft news RSS feed

The opinions expressed in this Weblog are those of the writer and may not represent the opinions of Network World.

Advertisement: