Ask Your Question
4

How can I obtain the current file or folder path and filename using ahk2.x?

asked 2023-04-30 23:49:31 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-01 00:01:01 +0000

ladyg gravatar image

You can use the built-in variable A_ScriptFullPath to obtain the full path and filename of the currently executing script.

To obtain the path of the folder containing the script, you can use the SplitPath command with the dir option.

Here's an example:

SplitPath, A_ScriptFullPath, , , dir
MsgBox, % "Current folder: " . dir . "`nCurrent file: " . A_ScriptFullPath

This will display a message box with the current folder path and the full path and filename of the script.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-04-30 23:49:31 +0000

Seen: 17 times

Last updated: May 01 '23