Jump to content

run( "myshortcut.lnk")


Recommended Posts

Before reading on, let me say that my special problem is already solved.

Now i am just curious: is it possible to start an application from AutoIt via it's windows shortcut?

Background:

I have a windows shortcut pointing to a DOS Application. The shortcut appears as "myshortcut.lnk" in the directory listing.

run( "c:myshortcut.lnk")
doesn't work, nothing happens.

Then i remembered those old-style shortcuts for DOS apps and created a PIF file pointing to the DOS Application. The pif appears as "myshortcut.pif" in the directory listing.

run( "c:myshortcut.pif")
works fine, the DOS app starts.

So in fact i my special problem is solved.

I am just wondering wether it is possible to start an application via it's windows shortcut.

Edited by qvex21

English is not my native language; please excuse typing errors.

Link to comment
Share on other sites

  • Moderators

Hi, qvex21. I have several DOS apps I run from shortcut, but I use ShellExecute instead of Run. Might be worth a try.

ShellExecute(@DesktopDir & "Myshortcut.lnk")

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Hi, qvex21. I have several DOS apps I run from shortcut, but I use ShellExecute instead of Run. Might be worth a try.

ShellExecute(@DesktopDir & "\Myshortcut.lnk")

Your solution works well. So I don't have to create further pifs on other workstations. Thank you very much.

English is not my native language; please excuse typing errors.

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