Jump to content

Recommended Posts

Posted

If the script is in the root of a drive, a slash is added to the path!!!

The manual clearly states "Directory containing the running script. (Result does not contain a trailing backslash)"

That's an hour I'll never get back! ..as they say on the imdb.

;o)

(or

nothing is foolproof to the sufficiently talented fool..

Posted

True that... mmmm... Workaround:

MsgBox (0, "", _ScriptDir())

Func _ScriptDir()
    $str = @ScriptDir
    If StringRight($str, 1) = "\"  Then
        $str = StringTrimRight($str, 1)
    EndIf
    Return $str
EndFunc  ;==>_ScriptDir
Posted

Oh, I already have one of those!

Weird how no one's noticed this before, eh!

;o)

(or

nothing is foolproof to the sufficiently talented fool..

Posted (edited)

I think it's Windows behavior. If you open Explorer, and you'll go to C: you'll see that the address bar display C:\. If you then go to the Windows folder it displays C:\Windows.

Even the command window does this:

C:\>cd windows

C:\WINDOWS>
Edited by Manadar
Posted

Yes, it is Windows. I realize that.

But if the manual states specifically that the slash is removed, then AutoIt should be ensure that it is!

And evidently the default value returned doesn't work under all situations, or else I'd have never realized there was a bug, would I?

;o)

(or

nothing is foolproof to the sufficiently talented fool..

Posted

It is a known problem and it's not a bug. Would you rather us return invalid paths when at the drive root? Because "C:" is an invalid path.

This is not going to be fixed. At best there will be a note added to the documentation.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...