Does anyone knows how can you get the volume name of a drive in windows?
I’m writting a program that should get the name of the cd or dvd
inserted in the drive. The user selects a directory using a gtk dialog
(filechooser), and then I have the path of the folder; but when you
select a cd/dvd, you get only the letter of the drive (E:, D:,…).
I have tried also File.dirname(name_of_a_file_in_the_dvd). It doesn’t
give you the cd/dvd name…
Thank’s in advance
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com
Does anyone knows how can you get the volume name of a drive in windows?
I’m writting a program that should get the name of the cd or dvd
inserted in the drive. The user selects a directory using a gtk dialog
(filechooser), and then I have the path of the folder; but when you
select a cd/dvd, you get only the letter of the drive (E:, D:,…).
I have tried also File.dirname(name_of_a_file_in_the_dvd). It doesn’t
give you the cd/dvd name…
Thank’s in advance
I guess there’s some WINAPI (use WIN32API) for that, or WScript (COM
→ use WIN32OLE) or WMI (COM). Just google a bit (and see Programming
Ruby how to use those libs).
I guess there’s some WINAPI (use WIN32API) for that, or WScript (COM
→ use WIN32OLE) or WMI (COM). Just google a bit (and see Programming
Ruby how to use those libs).
Thank you very much for the idea, I’m going to have a look at that win32ole
try:
Listing 4.3 Enumerating Disk Drive Properties
Set objFSO = CreateObject("Scripting.FileSystemObject")
I guess there’s some WINAPI (use WIN32API) for that, or WScript (COM
→ use WIN32OLE) or WMI (COM). Just google a bit (and see Programming
Ruby how to use those libs).
Thank you very much for the idea, I’m going to have a look at that
win32ole
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com
Jan S.
escribió:>> >> I have tried also File.dirname(name_of_a_file_in_the_dvd). It doesn’t
win32ole
Wscript.Echo "Drive type: " & objDrive.DriveType
When the script in Listing 4.3 runs under CScript, information similar
Serial number: 1343555846
require ‘win32ole’
puts “Root folder: #{drive.RootFolder}”
puts “Serial number: #{drive.SerialNumber}”
puts “Share name: #{drive.ShareName}”
puts “Total size: #{drive.TotalSize}”
puts “Volume name: #{drive.VolumeName}”
end
(beware, not tested code so errors can be there!)
That’s great! Thank’s a lot! I see why there is so many people
switching to ruby: the incredible comunity
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto. http://es.voice.yahoo.com
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.