Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to read volume label on DVD\CD

Status
Not open for further replies.

Count430

Programmer
Apr 26, 2002
127
US
Hello fellow scripters! can anyone tell me how I can read the label on a CDrom.

I created a windows installer package and now I need to distribute to folks on a slow link.

I set the package up in SMS which only has the command line and a Vbscript wrapper which asks the client to load the CD into the drive.

Once this happens the script checks for the drive and label to insure the correct media is loaded.

My problem is I don't know how to code the functionality where I want the script to read the label on the CD.

I already defined the label name in my declaration block of code. Any example will do to get me going in the right direction.

Thanks....
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objDrive = objFso.GetDrive(objFso.GetDriveName("D:\"))

Wscript.Echo "Label: " & objDrive.VolumeName
 
you might want to loop through a Drives collection, checking the .DriveType = 1 and then do your .GetDriveName check. that way you wonthave to worry which drive letter the client is using......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top