corz Posted November 15, 2007 Share Posted November 15, 2007 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.. Link to comment Share on other sites More sharing options...
BrettF Posted November 15, 2007 Share Posted November 15, 2007 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 Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
corz Posted November 15, 2007 Author Share Posted November 15, 2007 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.. Link to comment Share on other sites More sharing options...
Lazycat Posted November 15, 2007 Share Posted November 15, 2007 Btw, seems all Autoit functions that accept filename as parameter, works fine even when you have double backslash in path somewhere... So maybe this reason why this behaviour was unnoticied. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
jvanegmond Posted November 15, 2007 Share Posted November 15, 2007 (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 November 15, 2007 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
corz Posted November 15, 2007 Author Share Posted November 15, 2007 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.. Link to comment Share on other sites More sharing options...
Valik Posted November 15, 2007 Share Posted November 15, 2007 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. Link to comment Share on other sites More sharing options...
corz Posted November 15, 2007 Author Share Posted November 15, 2007 That's good enough. ;o) (or nothing is foolproof to the sufficiently talented fool.. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now