Modify

Opened 10 years ago

Closed 10 years ago

#843 closed Bug (No Bug)

@ScriptDir macro returning backslash when script is in drive root causes script to fail

Reported by: ssmith@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: @ScriptDir Macro Root Drive Cc:

Description

I know that this has been previously raised more than once bat has been declared as 'No Bug' but it DOES cause scripts to fail.

As was correctly pointed in the reply to bug #785, the drive root alone would be an invalid path (i.e. K:\ is valid, K: isn't) but it means that @ScriptDir & "\Fred.exe" expands to (say) K:
Fred.exe
which is also invalid.

I respectfully suggest that, on root of a drive, it would be better if @ScriptDir expanded to
Drive:\. which, in the example above would give the valid full path K:\.\Fred.exe

Attachments (0)

Change History (1)

comment:1 Changed 10 years ago by Valik

  • Resolution set to No Bug
  • Status changed from new to closed

The path "K:\.\Fred.exe" is likely to be just as invalid as "K:
Fred.exe" to any application failing on the latter.

This. Is. Not. A. Bug.

Stop opening tickets on it. We are not going to change the behavior. If this is an issue for you then you can fix it. One of the simplest ways is to write:

$dir = StringReplace(@ScriptDir & "\Fred.exe", "\\", "\")

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 ticket will remain with no owner.
Author


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

 
Note: See TracTickets for help on using tickets.