Solved

Read a CD/DVD volume label from coldfusion

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AWK: How to strip all double quotes from a file? 7 30
jsp error 6 42
import as existing maven project 3 34
What is the use of Forwarding Class in java 1 34
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 article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

685 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