Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Read a CD/DVD volume label from coldfusion

Posted on 2009-04-13
2
Medium Priority
?
365 Views
Last Modified: 2013-12-20
I'm reading data CD's and DVD's from the Server's DVD Drive.

I can't seem to find a way to read the CD or DVD label name (The name you give the DVD when you burn your data onto it)

I've used CFDIRECTORY to read all the file information off the CD but it doesn't seem to show the CD's name.

I'm using CF 8 on a W2K3 IIS Server
0
Comment
Question by:williambhowardjr
  • 2
2 Comments
 
LVL 36

Accepted Solution

by:
SidFishes earned 2000 total points
ID: 24129926
theres nothing in cf that can do it natively but it's do-able

relies on windows scripting host being installed, wmi available and cfexecute available

create a vbs file called getVolName.vbs

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colDrives = objWMIService.ExecQuery _
    ("Select * from Win32_LogicalDisk where DeviceID = 'c:'")
For Each objDrive in colDrives
wscript.echo objDrive.VolumeName
Next

then run the following

 <cfexecute name="C:\WINNT\system32\cscript.exe " arguments="//nologo c:\getVolName.vbs"  timeout="30" variable="result" />
                  <cfdump var="#result#">

the nologo atttribute suppress the ouput of "Microsoft (R) Windows Script Host Version..."  text so you only return the volume name





0
 
LVL 36

Expert Comment

by:SidFishes
ID: 24129939
btw

edit the deviceID in the vbs to point to the cd drive in question (probably d:)

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question