Modify

Opened 15 years ago

Closed 15 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 by GEOSoft, 15 years ago

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 by GEOSoft, 15 years ago

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 by Jon, 15 years ago

Milestone: 3.3.7.2
Owner: set to Jon
Resolution: Fixed
Status: newclosed

Fixed by revision [5991] in version: 3.3.7.2

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.