Custom Query


Show under each result:

Results (142 - 144 of 3841)

Ticket Resolution Summary Owner Reporter
#753 No Bug @ScriptDir does contain a trailing backslash on drive root. Decker87

@ScriptDir does return a trailing backslash when the script is on the root of the drive, e.g. "C:\". This can make some programs stop working when placed in the root of the drive.

#843 No Bug @ScriptDir macro returning backslash when script is in drive root causes script to fail ssmith@…

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:
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

#472 No Bug @ScriptDir returns a slash (\) when script run from root congo (seanw@…

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]

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

Note: See TracQuery for help on using queries.