Jump to content
Sign in to follow this  
swin4ort

How do I 'Run' a LNK (shortcut)

Recommended Posts

swin4ort

When I attempt to run a .LNK shortcut, AutoIt returns:

eg: Run("note.LNK","C:\")

Error: Unable to execute the external program

The system cannot find the file specified.

NB - I want to directly run the LNK shortcut directly - not to extract the terms from the LNK shortcut and execute them.

Share this post


Link to post
Share on other sites
swin4ort

I assume that the absence of a '\' after 'C:' is a typo. In either case,

ShellExecute("C:\note.lnk)

generates: Unknown function name

and I cannot find 'ShellExecute' in Help.

Is this a function later than the AutoIt version I am running?

Thanks for your help

IAN

Share this post


Link to post
Share on other sites
DW1

must be an old version of AutoIt

and there is no typo

"absence of a '\'" .... I see it on my screen.... let me copy and paste...

this is what I see

______________

ShellExecute ( "C:\Note.lnk" )

______________

Edited by danwilli

Share this post


Link to post
Share on other sites
Helge

Is this a function later than the AutoIt version I am running?

ShellExecute was added first in 3.2.1.7 beta and then later it made it into the stable versions

with 3.2.2.0. None of those are new so you must be running a pretty old version of AutoIt.

The currently latest version is 3.2.4.9 so I would recommend you to download that here :

http://www.autoitscript.com/forum/index.ph...&showfile=3

Share this post


Link to post
Share on other sites
Kip

Run("explorer.exe C:\Note.lnk")

(ShellExecute is better)

and for txt files:

Run("Notepad.exe C:\Note.txt")

and for images:

Run("MSPaint.exe C:\Note.bmp")

Edited by kip

Share this post


Link to post
Share on other sites
swin4ort

Uploaded new version of AutoIT & ShellExecute works perfectly with my LNK shortcuts.

Thanks for the help

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  

×