Solved

Read a CD/DVD volume label from coldfusion

Posted on 2009-04-13
2
347 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 500 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

832 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