Solved

Read a CD/DVD volume label from coldfusion

Posted on 2009-04-13
2
345 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
Comment Utility
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
Comment Utility
btw

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

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

772 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

11 Experts available now in Live!

Get 1:1 Help Now