Modify

Opened 13 years ago

Closed 13 years ago

#1860 closed Bug (Fixed)

DriveStatus Returns Ready with blank value

Reported by: aef03 <autoit.forums@…> Owned by: Jon
Milestone: 3.3.7.2 Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

I am trying to do code similar to the below.

When the registry key does not exist, I get the status "READY" back.

If my combination of statements means this is not a bug, I would like to request that this report be changed to a feature request for the below to work properly.

If DriveStatus(Regread("HKLM\Software\ABC","DriveLetter")) = "READY" Then $ABCDriveAvailable = True

Thanks much.

Attachments (0)

Change History (3)

comment:1 Changed 13 years ago by GEOSoft

What you have should work fine providing the information being returned from your RegRead() is correct. It should return in the format G:\ or just G: If it returns anything else including "G:" then you will have to fix the registry return to make it work.

$sDrive = StringRegExpReplace(Regread("HKLM\Software\ABC","DriveLetter"), "(?i)^.*([a-z]).*", "$1:")
If DriveStatus($sDrive) = "ready" Then $ABCDriveAvailable = True

You will have to provide an actual return value before this can really be checked.

comment:2 Changed 13 years ago by GEOSoft

Forget my last comment.
That looks like a bug in the DriveStatus function to me and it can be duplicated with

MsgBox(4096, "Drive Status", DriveStatus(""))

A work around is to verify that the drive exists

$sDrive = Regread("HKLM\Software\ABC","DriveLetter")
If FileExists($sDrive) Then
   MsgBox(4096, "Drive Status", DriveStatus($sDrive))
EndIf

comment:3 Changed 13 years ago by Jon

  • Milestone set to 3.3.7.2
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [5991] in version: 3.3.7.2

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jon.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.