Sign in to follow this  
Followers 0
scotty

Full path names from relative names

6 posts in this topic

I'm new to Autoit, so I'm still in learning mode.

Suppose I have created a file using a relative path name (e.g. ".\tmpfile", or ".\tempdir\tmpfile"). How do I determing the full (non-relative) path name of the file? I have tried using FileGetLongName(), but that only translates short file names to long file names. I'd rather not have to invoke a DOS command to this.

I'm sure I could come up with something using @WorkingDir and FileChangeDir(), but I was hoping there'd be some pre-defined function to pull this off.

Thanks for the help!


We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.

Share this post


Link to post
Share on other sites



It is hard to say without first seeing a script that creates the files. To create a file with autoit; you will need the full path anyway (whether its a macro or not).

However, if you are placing the file manually, you will need to search the computer for the file if you have no idea where it is.

Example when using a macro to place a file.

$File = @ScriptDir & "\File.txt"
MsgBox(0, "", $File)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Scotty Welcome to AutoIt

This is right of AutoIt help file...

#include <file.au3>
$TestPath = _PathFull(@ScriptDir & "..\..\test")
MsgBox(0,"demo _PathFull",@ScriptDir & @lf & $TestPath)

Hope this will help you...

Edited by Danny35d

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line

Share this post


Link to post
Share on other sites

Is _PathFull() in beta?


We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.

Share this post


Link to post
Share on other sites

Excellent! Thanks very much for the help!


We're more of the love, blood, and rhetoric school. Well, we can do you blood and love without the rhetoric, and we can do you blood and rhetoric without the love, and we can do you all three concurrent or consecutive. But we can't give you love and rhetoric without the blood. Blood is compulsory. They're all blood, you see.

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  
Followers 0