Solved

Read a CD/DVD volume label from coldfusion

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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 theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to dynamically set the form action using jQuery.

910 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now