erikcook
asked on
Determining a CDROM Drive LEtter with a variable output to a Batch File.
I have an unattended Windows XP Installation CD. At the end of the installation, I want a program to run that will prompt to insert the Windows 2003 CDROM and press ok. In the background I need it to autodetet the CDROM Drive letter and output it as a variable named %1.
Then it will run a command with the %1 in the command line... %1:\Office2003\setuppro.ex
I thought batch or a VBS would be the best way to go, but I dont know how to get the cdrom drive letter to detect and output as a variable.
Im looking for any kind of solution for this issue, wether it be in VB or batch... anything.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("S
For Each objItem in colItems
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "DeviceID: " & objItem.DeviceID
Wscript.Echo "DriveType: " & objItem.DriveTypeNext
check