AutoIt Forums: Run A Shortcut? - AutoIt Forums

Jump to content

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

Run A Shortcut?

#1 User is offline   Dev 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 53
  • Joined: 20-March 04
  • Location:Falsterbo, Sweden

Post icon  Posted 20 March 2004 - 07:37 PM

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 :)

#2 User is offline   Helge 

  • Sigh...
  • PipPipPipPipPipPipPip
  • Group: Full Members
  • Posts: 2,049
  • Joined: 12-December 03
  • Location:Norway

Posted 20 March 2004 - 07:46 PM

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 :
[ code='text' ]    ( Popup )
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"

#3 User is offline   Dev 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 53
  • Joined: 20-March 04
  • Location:Falsterbo, Sweden

Posted 20 March 2004 - 07:59 PM

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 :huh:
:iamstupid:

#4 User is offline   CyberSlug 

  • Overwhelmed with work....
  • Icon
  • Group: AutoIt MVPs(MVP)
  • Posts: 3,587
  • Joined: 03-December 03
  • Location:Kentucky, USA

Posted 20 March 2004 - 08:14 PM

Run(@ComSpec & " /c " & "C:\I am a\shortcut.lnk")

#5 User is offline   Dev 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 53
  • Joined: 20-March 04
  • Location:Falsterbo, Sweden

Posted 20 March 2004 - 10:13 PM

CyberSlug:
I dont get that to work :wacko:
Here is my code:
[ code='text' ]    ( Popup )
[...] Run(@ComSpec & " /c " & "c:/launcher.ink") [...]


:iamstupid:

#6 User is offline   Valik 

  • Do You Wanna Date My Avatar?
  • Icon
  • Group: Developers(Dev)
  • Posts: 14,938
  • Joined: 05-December 03
  • Gender:Male
  • Location:Silent Hill

Posted 20 March 2004 - 11:32 PM

Elll, not eye. Its a lowercase L, not an uppercase i. Its short for Link.

#7 User is offline   Dev 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 53
  • Joined: 20-March 04
  • Location:Falsterbo, Sweden

Posted 21 March 2004 - 12:35 PM

Oh, sorry...
"Maybe" thats why it doesnt work :lmao:


:iamstupid:

#8 User is offline   zCoCoz 

  • Newbie
  • Group: Members
  • Posts: 5
  • Joined: 16-March 04

Posted 25 March 2004 - 02:25 PM

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

This post has been edited by zCoCoz: 25 March 2004 - 02:25 PM


#9 User is offline   Dev 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 53
  • Joined: 20-March 04
  • Location:Falsterbo, Sweden

Posted 28 March 2004 - 05:16 PM

I get errors if I run the EXE...


:iamstupid:

#10 User is offline   Jos 

  • Mass Spammer!
  • Icon
  • Group: Developers(Dev)
  • Posts: 17,192
  • Joined: 03-December 03
  • Gender:Not Telling

Posted 28 March 2004 - 06:16 PM

And are you going to tell us what the error is or are you going to make us guess ???? :lmao:
Maybe showing the code that has the error also helps ....

#11 User is offline   ezzetabi 

  • さくらが さいた
  • PipPipPipPipPipPipPip
  • Group: Full Members
  • Posts: 2,011
  • Joined: 20-February 04

Posted 28 March 2004 - 06:45 PM

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

Edited as josbe advice.

This post has been edited by ezzetabi: 29 March 2004 - 07:50 AM


#12 User is offline   Josbe 

  • Infrequent ghost ☺
  • PipPipPipPipPipPip
  • Group: Full Members
  • Posts: 1,585
  • Joined: 28-January 04
  • Gender:Male

Posted 28 March 2004 - 11:52 PM

For this reason, the best way is to use the ', instead "
For example,
[ code='text' ]    ( Popup )
Run(@ComSpec & ' /c start "c:/launcher.lnk"') <- W2000 Run(@ComSpec & ' /c start c:/launcher.lnk') <- W9x


#13 User is offline   esfalk 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 59
  • Joined: 01-April 04
  • Location:United States

Posted 08 April 2004 - 08:27 PM

josbe, on Mar 28 2004, 05:52 PM, said:

For this reason, the best way is to use the ', instead "
For example,
[ code='text' ]    ( Popup )
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:

[ code='text' ]    ( Popup )
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... :mad:

This post has been edited by esfalk: 08 April 2004 - 08:30 PM


#14 User is offline   Jos 

  • Mass Spammer!
  • Icon
  • Group: Developers(Dev)
  • Posts: 17,192
  • Joined: 03-December 03
  • Gender:Not Telling

Posted 08 April 2004 - 08:41 PM

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

[ code='text' ]    ( Popup )
Run ( @ComSpec & ' /c "C:\Documents and Settings\UserName\Desktop\shortcut.lnk"' )


#15 User is offline   esfalk 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 59
  • Joined: 01-April 04
  • Location:United States

Posted 08 April 2004 - 08:56 PM

<sing> ... did you ever know that you're my hero ... </sing>

#16 User is offline   mircea 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 56
  • Joined: 18-April 07
  • Location:Romania - Oradea

Posted 17 May 2007 - 10:28 PM

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
[ code='text' ]    ( Popup )
Run ( @ComSpec & ' /c "C:\Users\All Users\Desktop\rds.ink"' )


ok i find the problem :D
[ code='text' ]    ( Popup )
#include <Process.au3> _RunDOS("ncpa.cpl")

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

This post has been edited by mircea: 17 May 2007 - 11:11 PM


#17 User is offline   snowman533 

  • Advanced Member
  • PipPip
  • Group: Full Members
  • Posts: 115
  • Joined: 01-April 09

Posted 06 April 2009 - 12:04 PM

i am having the same problem

[ code='text' ]    ( Popup )
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

#18 User is online   GEOSoft 

  • Mr. Nice Guy = False
  • Icon
  • Group: AutoIt MVPs(MVP)
  • Posts: 8,198
  • Joined: 08-December 03
  • Gender:Male
  • Location:Nanaimo, BC, Canada

Posted 06 April 2009 - 12:15 PM

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

#19 User is offline   snowman533 

  • Advanced Member
  • PipPip
  • Group: Full Members
  • Posts: 115
  • Joined: 01-April 09

Posted 06 April 2009 - 12:17 PM

i got an error

cannot find C:\Documents and settings\.....\Desktop\BitComet.lnk

somehow i dont think its ".lnk"

#20 User is online   GEOSoft 

  • Mr. Nice Guy = False
  • Icon
  • Group: AutoIt MVPs(MVP)
  • Posts: 8,198
  • Joined: 08-December 03
  • Gender:Male
  • Location:Nanaimo, BC, Canada

Posted 06 April 2009 - 12:22 PM

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.

  • (3 Pages)
  • +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users