Dear
Staid,
I am curious to know what you are going to do with the created text files (the file listing of CD Contents).
Sometime before I created a script which does something very similar- a kind of CD Catologue app which will store the File listing for a CD/DVD in a text file. I used those text files to search for a particular file in my (Huge!)collection of free CD's that came along with Computer magazines.
90% through, I lost the script in a Hard Drive crash

.
Anyways! I would like to quote the technique I used to name the text files.
We can get the Unique CD Serial number - like what you see in the above snapshot...
and name the text file with it ..
Volume Serial Number is 1846-3CCB
For this
CD with Serial number
1846-3CCB we can create a textfile named
1846-3CCB.txt and list the contents to it.
Code:
CDROM:="I:" ; Replace the "I:" with your CD/DVD Drive letter
DriveGet, SerialNumber, Serial, %CDROM%
Textfile=% VolumeSerialHex(SerialNumber) ".txt"
;Check whether the file already exists and if not write the file listing
IfNotExist, %TextFile%
Loop, %CDROM%\*.*, 0, 1
FileAppend, %A_LoopFileLongPath%`n, %TextFile%
Run, %TextFile%,,Max
Return
VolumeSerialHex(_Serial)
{
; by A.N.Suresh Kumar aka Goyyah - 2006-05-07
SetFormat, integer, hex
_Serial+=0
SetFormat, integer, d
StringReplace, _Serial, _Serial, 0x,, All
StringUpper, _Serial, _Serial
_Serial=00000000%_Serial%
StringRight, _Serial, _Serial, 8
StringMid, _S1, _Serial, 1, 4
StringMid, _S2, _Serial, 5, 4
_Serial = % _S1 "-" _S2
Return _Serial
}
Try the above code (make sure varible
CDROM contains a valid drive letter).
However, REMEMBER that this technique does have limitations :
A Hard Disk Partition will have a
new serial number every time it is formatted
and this is also applicable to Rewritable CD's.
Regards,

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link