Jump to content

Run A Shortcut?


Dev
 Share

Recommended Posts

Ive found out that the only way to run one of my "homemade" C++ apps via AutoIt is to run it via a shortcut. Nothing else does work. Can i have AutoIt to run a shortcut in the same folder as the EXE-file?

Thanks for looking at this, hope you can help me :whistle:

Link to comment
Share on other sites

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Ive found out that the only way to run one of my "homemade" C++ apps via AutoIt is to run it via a shortcut. Nothing else does work.

WHAT ?! Nah..

Are you sure that you're using Run properly ?

Run ("filename", "workingdir", flag)

Example :

Run ("CPlusPlusProgram.exe", "C:\MyPrograms", @SW_MAXIMIZE)
Are you sure that you are pointing "workingdir" to the correct directory ?

If you're C++ program is in the same directory as the AutoIt-script,

then you can use @ScriptDir instead of "C:\MyPrograms"

Link to comment
Share on other sites

I tried everything, but its something in the parameters as causing this problem, i dont know why. I need hmm... two parameters, it works fine if i use the shortcut, but not if i run it via AutoIt...

Strange... Very strange :whistle:

:iamstupid:

Link to comment
Share on other sites

  • Developers

And are you going to tell us what the error is or are you going to make us guess ???? :whistle:

Maybe showing the code that has the error also helps ....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 2 weeks later...

For this reason, the best way is to use the ', instead "

For example,

Run(@ComSpec & ' /c start "c:/launcher.lnk"') <- W2000
Run(@ComSpec & ' /c start c:/launcher.lnk') <- W9x
@josbe or ezzetabi: I'm havin' a bit of trouble w/ this one... apparently it doesn't like to launch shortcuts that are located on the desktop? Dumb question: just add the .lnk to the end of the shortcut's title?

Here's my code:

Run ( @ComSpec & ' /c start "C:\Documents and Settings\UserName\Desktop\shortcut.lnk"' )

No dice; error message below:

Cannot find the file 'C:\Documents' (or one of its components).  Make sure the path and filename are correct and that all required libraries are available.

:postal:

EDIT: Well, now I'm around that error message, but rather than launching the shortcut it gives me a dos-esk command prompt to a folder on my desktop... :D

Edited by esfalk
Link to comment
Share on other sites

  • Developers

why use start ? .... try it this way to see if that helps:

Run ( @ComSpec & ' /c "C:\Documents and Settings\UserName\Desktop\shortcut.lnk"' )

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • 3 years later...

well i try to make a program that runs a shortcut from the desktop or better say the internet PPPoE i want to run but i cant make it work

can someone help me ???

the problem is that is working too fast i mean i cant see nothing :|

or can you give me some idea or source code of some how i can run a internet conection shortcut ??? ( i want to make to auto start my internet conection with out going in control panel -> network connection -> rds -> enter

Run ( @ComSpec & ' /c "C:\Users\All Users\Desktop\rds.ink"' )

ok i find the problem :)

#include <Process.au3>
_RunDOS("ncpa.cpl")

my god ( i never think at that in all my life)

Edited by mircea
Link to comment
Share on other sites

  • 1 year later...

i am having the same problem

Run ( @ComSpec & '/c C:\Documents and Settings\Aria\Desktop\BitComet.lnk"' )

nothing happens when the script is run, it just sits there, how the heck do i launch a shortcut? the above posts have done nothing to help me i have followed all

Intermediate AutoIt/Autohotkey User

Link to comment
Share on other sites

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

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Check that with FileExists()

If FileExists(@DeskTopDir & "\bitcomet.lnk") Then MsgBox(0, "Results", "It's a link")

There is another way to do it if it is actually a lnk file but you will need to know that first.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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