Welcome to Sign in | Join | Help
in
Home Blog Forums

The Lazy Admin

Guest Post: Script to install and manage virtual CD / DVD drives

Sponsor


This great article come from Michael Khanin (MCP, MCP+I, CNA, CNE, MCSE) who also blogs on his blog site http://TheSystemAdministrator.com 

Recently there was a necessity to install a Virtual CD/DVD on many computers on the same network. And it was necessary, that the virtual CD/DVD would be set to a special letter in the system. Right now there are a lot of programs which emulate CD/DVD and can mount any CDs/DVD images, as I wished to make all installation and configuration run remotely (well laziness by me, not wanting to run from computer to computer) It was necessary for the program to install in silent mode. After a quick search I chose МagicDisc.

I've selected this program for several reasons:

1. The program is free-of-charge (but not all options work in the free-of-charge version, but what is necessary for me, works)

2. There is opportunity to run setup in silent mode.

3. It is possible to operate all necessary functions from a command line.

For a more satisfiying management experience from the command line one more file, Miso.exe is required.

The given file can be found on the МagicDisc site.

For the installation I have written a script, INSTALL-V-CD.bat.

INSTALL-V-CD.bat is very simple and contains just one line:

setup_magicdisc.exe /S

To start the script on a remote system I used psexec.exe which can be downloaded here.

After the installation of МagicDisc, it was necessary to copy miso.exe to the remote computer. It is important to note that miso.exe should be located in a directory which is registered in the system PATH.

Now the most interesting part. We create virtual a CD and assign to it the letter we want. For this purpose I have written one more script, MOUNT-ISO.bat. MOUNT-ISO.bat contains:

@ECHO off

miso NULL -sdrv 0

miso NULL -sdrv 1

For /F "tokens=4 delims=(,) " %%a in ('miso NULL -vlist^|find "[1]"') do Set VCD=%%a

@ECHO select volume %VCD% > %TEMP%\ChangeCDDrive.txt

@ECHO assign letter=S >> %TEMP%\ChangeCDDrive.txt

@ECHO exit >> %TEMP%\ChangeCDDrive.txt

Diskpart /S %TEMP%\ChangeCDDrive.txt

Del %TEMP%\ChangeCDDrive.txt /Q

In my case, I assigned the virtual CD the letter "S".

To mount an ISO file, execute a following command:

miso NULL -mnt S: "ISO-IMG.ISO"

The End! :)





Published Tuesday, June 05, 2007 8:30 AM by daniel.nerenberg
Filed under:

Comments

 

Casper42 said:

Then of course if you need to access this from a GUI but quickly, you can create a shortcut to the batch file and put the shortcut in your "Send to" menu.

Then you can right click on an ISO or other image file and say Send to -> Mount-ISO and the batch file will be invoked with the full path to the ISO submitted as a command line argument.

February 29, 2008 5:51 PM
Anonymous comments are disabled

About daniel.nerenberg

I am an MCT, Consultant based out of Montreal Quebec Canada. As the "new" Lazy Admin on the block I am working to make TheLazyAdmin.com the best website for MS Software tips and tricks out there!

This Blog

Powered By

 

Syndication

Sponsors

 
 
Get a free 5GB e-mail account @isalazyadmin.com

Certifications & Awards




All postings are provided "AS IS" with no warranties, and confer no rights.
Microsoft product screen shot(s) reprinted with permission from Microsoft Corporation.