Jump to content
Sign in to follow this  

Relative folders and fileGetLongName()

Recommended Posts


I can't get fileGetLongName() to convert a path like:


If I pass just 'foobar', it's resolving to my script folder + "\foobar" (cuz I have a folder there with that name)

I want this to return back the foobar folder that is 2 levels up but it constantly returns '..\..\foobar'.

According the the help file, passing a 1 with this function enables relative support but at the same time it indicates that you need to pass a full path.


Any ideas.

Sean Shrum :: http://www.shrum.net

All my published AU3-based apps and utilities

'Make it idiot-proof, and someone will make a better idiot'


Share this post

Link to post
Share on other sites

StringTrimRight(@ScriptDir,x) where x is so many characters to go back ??

Who needs puzzles when we have AutoIt!!

Share this post

Link to post
Share on other sites

This works fine for me:

$str = FileGetLongName("..\..\java", 1)
ConsoleWrite("$str = " & $str & @LF)


$str = C:\Program Files\Java

Did you forget the "relative path" flag?


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post

Link to post
Share on other sites

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
Sign in to follow this