Jump to content

Recommended Posts

Posted

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:

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

  Quote

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 ?

  Quote

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"

Posted

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:

Posted

CyberSlug:

I dont get that to work :whistle:

Here is my code:

[...]
Run(@ComSpec & " /c " & "c:/launcher.ink")
[...]

:iamstupid:

Posted (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 by zCoCoz
Posted (edited)

Run(@ComSpec & ' /c start "" c:/launcher.lnk') <- W2000

Run(@ComSpec & ' /c start c:/launcher.lnk') <- W9x

Edited as josbe advice.

Edited by ezzetabi
  • 2 weeks later...
Posted (edited)

  josbe said:

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:

  Quote

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
  • 3 years later...
Posted (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 by mircea
  • 1 year later...
Posted

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

Posted

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

George

  Reveal hidden contents
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!"

Posted

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

  Reveal hidden contents
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!"

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...