Modify

Opened 16 years ago

Closed 16 years ago

#472 closed Bug (No Bug)

@ScriptDir returns a slash (\) when script run from root

Reported by: congo (seanw@… Owned by:
Milestone: Component: AutoIt
Version: 3.2.12.0 Severity: None
Keywords: @ScriptDir Documentation Cc:

Description

In AutoIT v3.2.12.0, @ScriptDir is documented as NOT returning a trailing slash(\), however due to the Win API if a compiled script is run from a drive root (like an autorun DVD/CD) it does infact return a trailing backslash.

Easy to work around if you can't be 100% sure of where the app will be run:

	$myscript = @ScriptDir
	If StringRight($drive, 1) == "\" Then ;in root of a drive a trailing slash is returned by Windows!
		$t = StringSplit($drive, "\")
		$myscript = $t[1]
	EndIf

The documentation may need to be updated, or the macro modified

Attachments (0)

Change History (2)

comment:1 Changed 16 years ago by congo (seanw@…

Sorry, ahem,

Global $myscript = @ScriptDir
If StringRight($myscript, 1) == "\" Then ;in root of a drive a trailing slash is return by Windows!
	$t = StringSplit($myscript, "\")
	$myscript = $t[1]
EndIf

comment:2 Changed 16 years ago by Valik

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

The choices are, return a trailing slash when run from the drive root, or return an invalid path. I don't think I need to explain any further why it does what it does.

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.