Jump to content
Sign in to follow this  
everseeker

[RESOLVED]How do I "Run" a shortcut?

Recommended Posts

everseeker

I have a shortcut that I have to "execute"... can't just go run the .exe file... need to use this silly shortcut

But the following:

Run("C:\Documents and Settings\pbm0869\Start Menu\Programs\Humana\RateCalculator8", "")

produces: Unable to execute the external program.

Any suggestions?

Edited by everseeker

Everseeker

Share this post


Link to post
Share on other sites
ProgAndy

Does Shellexecute work?


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
everseeker

Does Shellexecute work?

hmmm.... I shall investigate...


Everseeker

Share this post


Link to post
Share on other sites
spudw2k

You could also try "Start.exe"

edit: A workaround maybe required. Start doesn't work right on links if it's not running from the same dir.

My workaround is cd to the dir first then use start to run the link.

Still trying to code it in auto it.

See post below.

Edited by spudw2k

Share this post


Link to post
Share on other sites
jben

Run("C:\Documents and Settings\pbm0869\Start Menu\Programs\Humana\RateCalculator8.lnk", "") <--you forgot the .lnk

sorry spud i can see you included it within your code, just thought i would highlight this..

Edited by jben

Share this post


Link to post
Share on other sites
spudw2k

This do?

Run(@comspec & " /c cd " & chr(34) & "C:\Documents and Settings\pbm0869\Start Menu\Programs\Humana\" & chr(34) & " && start " & "RateCalculator8.lnk")
Edited by spudw2k

Share this post


Link to post
Share on other sites
everseeker

hmmm.... I shall investigate...

nope...

A little more info...

this is a "Clickonce" installation... the file in question carries an extension of .appref-ms

pop that into Google to see what my problem is....

So far, I have tried:

; Launch Rate Calc
 ;Run("C:\Documents and Settings\pbm0869\Start Menu\Programs\Humana\RateCalculator8", "")
 ;Run("C:\Documents and Settings\pbm0869\Start Menu\Programs\Humana\RateCalculator8.appref-ms", "")
 ;Run(FileOpenDialog("Launch Rate Calculator", "C:\Documents and Settings\pbm0869\Start Menu\Programs\", "All(*.*)", 1, "RateCalculator8*"))
 ;ShellExecute("RateCalculator8", "", "C:\Documents and Settings\pbm0869\Start Menu\Programs\", "[email=""]", "@SW_MAXIMIZE[/email]")
 ShellExecute("RateCalculator8.appref-ms", "", "C:\Documents and Settings\pbm0869\Start Menu\Programs\", "[email=""]", "@SW_MAXIMIZE[/email]")

No joy for any of the above....

Edit - Trying Spud with .appref-ms mod

Edited by everseeker

Everseeker

Share this post


Link to post
Share on other sites
everseeker

Edit - Trying Spud with .appref-ms mod

OOhhhh a Gold star to the Potato in the back row!!!

That worked!

(or rather:)

Run(@comspec & " /c cd " & chr(34) & "C:\Documents and Settings\pbm0869\Start Menu\Programs\Humana\" & chr(34) & " && start " & "RateCalculator8.appref-ms")

Everseeker

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.