Jump to content

Shortcut Path


RobRod
 Share

Recommended Posts

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?

Link to comment
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.

Link to comment
Share on other sites

  • 2 weeks later...

@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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...