Dev Posted March 20, 2004 Share Posted March 20, 2004 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 Link to comment Share on other sites More sharing options...
Helge Posted March 20, 2004 Share Posted March 20, 2004 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 More sharing options...
Dev Posted March 20, 2004 Author Share Posted March 20, 2004 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 :iamstupid: Link to comment Share on other sites More sharing options...
CyberSlug Posted March 20, 2004 Share Posted March 20, 2004 Run(@ComSpec & " /c " & "C:\I am a\shortcut.lnk") Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Dev Posted March 20, 2004 Author Share Posted March 20, 2004 CyberSlug: I dont get that to work Here is my code: [...] Run(@ComSpec & " /c " & "c:/launcher.ink") [...] :iamstupid: Link to comment Share on other sites More sharing options...
Valik Posted March 20, 2004 Share Posted March 20, 2004 Elll, not eye. Its a lowercase L, not an uppercase i. Its short for Link. Link to comment Share on other sites More sharing options...
Dev Posted March 21, 2004 Author Share Posted March 21, 2004 Oh, sorry... "Maybe" thats why it doesnt work :iamstupid: Link to comment Share on other sites More sharing options...
zCoCoz Posted March 25, 2004 Share Posted March 25, 2004 (edited) i had trouble with that before to but i never got it to work i finally just told it to use the run.exe thing Edited March 25, 2004 by zCoCoz Link to comment Share on other sites More sharing options...
Dev Posted March 28, 2004 Author Share Posted March 28, 2004 I get errors if I run the EXE... :iamstupid: Link to comment Share on other sites More sharing options...
Developers Jos Posted March 28, 2004 Developers Share Posted March 28, 2004 And are you going to tell us what the error is or are you going to make us guess ???? 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 More sharing options...
ezzetabi Posted March 28, 2004 Share Posted March 28, 2004 (edited) Run(@ComSpec & ' /c start "" c:/launcher.lnk') <- W2000 Run(@ComSpec & ' /c start c:/launcher.lnk') <- W9x Edited as josbe advice. Edited March 29, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
Josbe Posted March 28, 2004 Share Posted March 28, 2004 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 • AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
esfalk Posted April 8, 2004 Share Posted April 8, 2004 (edited) 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... Edited April 8, 2004 by esfalk Link to comment Share on other sites More sharing options...
Developers Jos Posted April 8, 2004 Developers Share Posted April 8, 2004 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 More sharing options...
esfalk Posted April 8, 2004 Share Posted April 8, 2004 <sing> ... did you ever know that you're my hero ... </sing> Link to comment Share on other sites More sharing options...
mircea Posted May 17, 2007 Share Posted May 17, 2007 (edited) 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 May 17, 2007 by mircea Link to comment Share on other sites More sharing options...
snowman533 Posted April 6, 2009 Share Posted April 6, 2009 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 More sharing options...
GEOSoft Posted April 6, 2009 Share Posted April 6, 2009 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 More sharing options...
snowman533 Posted April 6, 2009 Share Posted April 6, 2009 i got an error cannot find C:\Documents and settings\.....\Desktop\BitComet.lnk somehow i dont think its ".lnk" Intermediate AutoIt/Autohotkey User Link to comment Share on other sites More sharing options...
GEOSoft Posted April 6, 2009 Share Posted April 6, 2009 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now