Sign in to follow this  
Followers 0
RobRod

Shortcut Path

4 posts in this topic

Hello there,

I use this code to save a screenshot:

_ScreenCapture_CaptureWnd(@ScriptDir & "\blubb.jpg", $hWnd)

I execute my script from different directories by shortcuts. Of course the screenshots always saves to the folder where my *.exe is located.

For example, if my script is "c:autoitscript.exe" and I place a shortcut to this executable on my desktop, the screenshot will still be saved to c:autoit - and not on the desktop. Is there something like @ShortcutDir or how to manage this?

Share this post


Link to post
Share on other sites



So you want the screenshot file to be put in the directory from where it's calling shortcut is located, and not in the directory where the script (no matter whether it's compiled or not) is located? Replace the @ScriptDir macro with the @WorkingDir macro. Actually, I don't know for sure that that will work. Well, I know the ScriptDir macro needs to be replaced, but I'm not entirely sure it's the WorkingDir one. See the Help file (in the Macros category) for all.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

@Nikolle: the result is exactly the same. It gives the path where the .exe is located, not from where it is called from (the shortcut).

@somdcomputerguy: tried this already, also read the help file. Looks like there is nothing that works right now (or more programming is needed). I just use a directory select dialog for now. Thank you both.

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