Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Driveget on DVD-drive does not work properly


  • Please log in to reply
14 replies to this topic
sheepdog
  • Members
  • 11 posts
  • Last active: Nov 29 2012 12:13 PM
  • Joined: 31 Jul 2005
I have two DVD drives.

HL-DT-ST DVD-ROM GDR8161B
TSSTcorp CD/DVDW TS-H552U

When I use
driveget, StatusCD, w
with CD inserted I get Status "stopped"
when I do the same with a DVD I get "Drive not ready, although I can acccess the files on the DVD with my filemanager.

When I try to use

driveget, serial (Label,FS), w:


I get acceptable results for CD and empty values for DVD.

I'm using V 1.0.40.00

sheepdog

[edit]
I just updated to V 1.0.40.11. Now I get good results for serial, label and FS.
But still the 'not ready' for StatusCD.

Maybe there should be an additional command StatusDVD?

[/edit]

sheepdog

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Thanks for the report.

I don't currently have a DVDrom to it with, so does anyone else get "not ready" when using "DriveGet, OutputVar, StatusCD, D:" on a DVD-rom drive that contains a non-blank CD or DVD?

The "DriveGet StatusCD" command internally calls mciSendString("status cd mode", ...) and simply returns the result.

Edit: Fixed syntax.

  • Guests
  • Last active:
  • Joined: --
Actually the command should be:

driveget, Outputvar ,StatusCD,D:

sheepdog

  • Guests
  • Last active:
  • Joined: --
I requested the verification in the Total Commander Forum where at least one User can confirm this bug.

sheepdog

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Thanks for the verification. It looks like StatusCD can't detect the presence of a readable DVD in a DVD-capable drive. I'd appreciate it if at least one more person can confirm this result using something like:
DriveGet, OutputVar, StatusCD, D:

Until a solution/enhancement is found, I'll update the documentation to reflect this limitation.

Thanks.

corrupt_notloggedin
  • Guests
  • Last active:
  • Joined: --
Confirmed here:
DriveGet, OutputVar2, Label, H:
DriveGet, OutputVar, StatusCD, H:
MsgBox, ErrorLevel: %ErrorLevel%`nStatusCD: %OutputVar%`nLabel: %OutputVar2%`nAHK Version: %A_AhkVersion%
Result:

---------------------------
New AutoHotkey Script (3).ahk
---------------------------
ErrorLevel: 0
StatusCD: not ready
Label: DARK_WATER
AHK Version: 1.0.40.11
---------------------------
OK
---------------------------



Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Thanks a lot.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
If anyone has an interest in DVD media status, please try out the following script and see if it retrieves anything useful:

MsgBox % "Drive status is: " . GetDVDStatus("D:")

GetDVDStatus(DriveLetterWithColon)  ; Caller passes in something like "D:".
{
	if DllCall("winmm\mciSendString", str, "open " . DriveLetterWithColon
		. " type videodisc alias MyDVD wait shareable", uint, 0, uint, 0, uint, 0)
		return "Error opening the device."
	DVDStatusCapacity := VarSetCapacity(DVDStatus, 100, 0)
	error := DllCall("winmm\mciSendString", str, "status MyDVD mode", str, DVDStatus
		, uint, DVDStatusCapacity, uint, 0)
	DllCall("winmm\mciSendString", str, "close MyDVD wait", uint, 0, uint, 0, uint, 0)
	if error
		return "Error obtaining status."
	else
		return DVDStatus
}

You can also try replacing "status MyDVD mode" with "status media present" (returns TRUE if the media is inserted in the device or FALSE otherwise), "status side" (returns 1 or 2 to indicate which side of the videodisc is loaded), or "status media type" (returns the type of the media. For videodiscs, this is "CAV", "CLV", or "other", depending on the type of videodisc).

There's more info at http://msdn.microsof... ... tus_mm.asp
There are also many other commands besides "status".

If any of this proves useful, it could be added as an example to the help file.

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
All returns an empty string here... :(

sheepdog
  • Members
  • 11 posts
  • Last active: Nov 29 2012 12:13 PM
  • Joined: 31 Jul 2005
empty strings here too.

sheepdog

kapege.de
  • Members
  • 192 posts
  • Last active: Jan 16 2012 12:34 PM
  • Joined: 07 Feb 2005
Me too. Empty string. Using an external Ricoh MP 5316 DA connected via USB, inserted a Movie, also empty with a data disk and a CD.
Peter

Wisenheiming for beginners: KaPeGe (German only, sorry)

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Thanks for trying it. Maybe "videodisc" doesn't include DVDs.

If anyone still has an interest, perhaps you can try to decipher the rather cryptic documentation at MSDN (linked above). I couldn't find much material on the web beyond what's at MSDN.

sheepdog
  • Members
  • 11 posts
  • Last active: Nov 29 2012 12:13 PM
  • Joined: 31 Jul 2005
I did not try with video disc but data disc. If I can retrieve some info how to get DVD Status I will report that here.

Thanks for your efforts. BTW AHK is a real great Proggy.

sheepdog

sheepdog
  • Members
  • 11 posts
  • Last active: Nov 29 2012 12:13 PM
  • Joined: 31 Jul 2005
I don't know if this is of any help but the following vb-script (written for the vb-script plugin of Total Commander) seems to be able to get the driveinfo correctly.
'Script for Script Content Plugin
'(c)Lev Freidin, 2005
'http://www.totalcmd.net/plugring/script_wdx.html
'http://wincmd.ru/plugring/script_wdx.html

Dim fso, dc
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives

For Each d In dc

   'Verfügbare Eigenschaften (mit '+' gekennzeichnete Eigenschaften werden durch das Script angezeigt)
   '+ d.AvailableSpace
   '+ d.DriveLetter
   '+ d.DriveType
   '+ d.FileSystem
   '- d.FreeSpace
   '+ d.IsReady
   '- d.Path
   '- d.SerialNumber
   '+ d.ShareName
   '+ d.TotalSize
   '+ d.VolumeName

   If filename = "[-" & d.DriveLetter & "-]" Then

      Select Case d.DriveType
         Case 0: strDriveType = "Unbekannt"
         Case 1: strDriveType = "Wechselplatte"
         Case 2: strDriveType = "Festplatte"
         Case 3: strDriveType = "Netzwerk"
         Case 4: strDriveType = "CD-ROM"
         Case 5: strDriveType = "RAM-Disk"
      End Select

      'strDriveInfo = d.DriveLetter & " • " & strDriveType
      strDriveInfo = strDriveType

      If d.IsReady Then

         If d.DriveType = 3 Then
            strDriveInfo = strDriveInfo & " [" & d.ShareName & "]"

         Else
            If d.VolumeName = "" Then
               strDriveInfo = strDriveInfo & " [_ohne_]"
            Else
               strDriveInfo = strDriveInfo & " [" & d.VolumeName & "]"
            End If

         End If

         strDriveInfo = strDriveInfo & " • " & d.FileSystem

         intExp = Fix(Log(d.TotalSize) / Log(1024))
         Select Case intExp
            Case 0: strUnit = " Bytes"
            Case 1: strUnit = " KiB"
            Case 2: strUnit = " MiB"
            Case Else
               intExp = 3
               strUnit = " GiB"
         End Select

         strDriveInfo = strDriveInfo & " • " & FormatNumber(d.TotalSize / (1024^intExp), 2) & strUnit & " gesamt"

         'strDriveInfo = strDriveInfo & " • " & FormatNumber(d.FreeSpace / (1024^intExp), 2) & strUnit
         'strDriveInfo = strDriveInfo & " (" & FormatPercent(d.FreeSpace / d.TotalSize, 0) & ") verfügbar"
         strDriveInfo = strDriveInfo & " • " & FormatNumber(d.AvailableSpace / (1024^intExp), 2) & strUnit
         strDriveInfo = strDriveInfo & " (" & FormatPercent(d.AvailableSpace / d.TotalSize, 0) & ") verfügbar"

         'strDriveInfo = strDriveInfo & " • " & FormatNumber((d.TotalSize - d.FreeSpace) / (1024^intExp), 2) & strUnit
         'strDriveInfo = strDriveInfo & " (" & FormatPercent(1 - d.FreeSpace / d.TotalSize, 0) & ") belegt"
         strDriveInfo = strDriveInfo & " • " & FormatNumber((d.TotalSize - d.AvailableSpace) / (1024^intExp), 2) & strUnit
         strDriveInfo = strDriveInfo & " (" & FormatPercent(1 - d.AvailableSpace / d.TotalSize, 0) & ") belegt"

      Else
         strDriveInfo = strDriveInfo & " • Laufwerk nicht bereit (Kein Datenträger eingelegt)"

      End If

   End If

Next

content = strDriveInfo

sheepdog

vbcrayon
  • Members
  • 1 posts
  • Last active: Aug 17 2014 07:31 PM
  • Joined: 17 Aug 2014

Nothing? DriveGet does not work correctly with CD or DVD.