Sign in to follow this  
Followers 0
cowsrule

How Can I make my script run a program

18 posts in this topic

Hi Iam new to autoit and i have a script that displays a dialog box when clicked

but i want it to launch a program too

can someone please help me

Share this post


Link to post
Share on other sites



Hi Iam new to autoit and i have a script that displays a dialog box when clicked

but i want it to launch a program too

can someone please help me

There are many ways to do this...

Show us some script, so we an help you in YOUR direction

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

There are many ways to do this...

Show us some script, so we an help you in YOUR direction

8)

In case you didn't understand what Valuater just said, he basically said we can't help you because you didn't give us anything to help you with. What you did was analagous to asking for help building a house, but failing to mention the location of where the house is to be built, what materials to use, where to find them, etc. By telling us you wanted it to run another program, you basically said that you want the house to be blue. Of course, this doesn't help us, because we are totally left out in the dark and since you didn't supply us with what you have, we can't help.

This is to everyone on the forum:

We only help you as much as you give us to help you with.


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Pretty much you can just do an "& Run (Details here)"

Edited by alex OF DEATH

Share this post


Link to post
Share on other sites

so far this is the script with the dialog box text hidden

#NoTrayIcon

Dim $Message1

Dim $Message2

Dim $Message3

Dim $Title

$Title = "(text here)"

$Message1 = "(text here)"

$Message2 = "(text here)"

$Message3 = ""(text here)"

MsgBox(266304,$Title,$Message1 & @CRLF & $Message2 & @CRLF & $Message3)

what should i add to it to make it run a program too?

Share this post


Link to post
Share on other sites

$Message3 = ""(text here)"
[b]First way:[/b] Run (etc...)
MsgBox(266304,$Title,$Message1 & @CRLF & $Message2 & @CRLF & $Message3) [b]Second way:[/b] & Run (etc...)

what should i add to it to make it run a program too?

Do you want the text and the program to run at same time? I see two ways to do it, which I edited from the quote. Its on the line it should be on, just delete the bolded part.

Share this post


Link to post
Share on other sites

As alex said you have to add a sth like this anywhere in your script:

Run("C:\senselesfolder\senseless.exe")

"It's easier to disintegrate an atom than a prejudice." (A.Einstein)---------------------------------------------------------------------------My C++ - tools:Tidy tool-->indents your c++ sourceCleanscript --> cleans autoit-code before compiling (co-author: peethebee)My tools:GUIBuilder-->build your window and get the source; german versionMy Games:OnlineGameCenter-->Online Chess and Connect4 with a rtf-chatSnake-->including a level editor to build your own levelsTetris-->the well known game, big funOther things:Tower of Hanoi-->perfect riddler with graphic output

Share this post


Link to post
Share on other sites

thanks for the help i will post the result of the script in a few min

Share this post


Link to post
Share on other sites

so do i use the seconhd way or the first way

as i want to keep the dialog box

Share this post


Link to post
Share on other sites

i tryed run C:\Documents and Settings\Brandon\Desktop\thefilename.exe

and it just made 2 dialog boxes come up instead of one

lol

what now

and i am just starting at programing/scripting so i am really not good at this

Share this post


Link to post
Share on other sites

i tryed run C:\Documents and Settings\Brandon\Desktop\thefilename.exe

and it just made 2 dialog boxes come up instead of one

lol

what now

We don't know. We can't see what you did.

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

i tryed run C:\Documents and Settings\Brandon\Desktop\thefilename.exe

and it just made 2 dialog boxes come up instead of one

lol

what now

and i am just starting at programing/scripting so i am really not good at this

Did you add the Parenthesese that were required? As in Run ( file path here )

And the quotes on the files path. Can't forget that.

Edited by alex OF DEATH

Share this post


Link to post
Share on other sites

ok i am posrting my dialog csript

#NoTrayIcon

Dim $Message1

Dim $Message2

Dim $Message3

Dim $Title

$Title = "test here"

$Message1 = "test here"

$Message2 = "test here"

$Message3 = "test here"

MsgBox(266304,$Title,$Message1 & @CRLF & $Message2 & @CRLF & $Message3)

can you add to it to make it run a file at C:\"thefilename"

then post it and i will change the file name so it runs the right one

Share this post


Link to post
Share on other sites

ok i am posrting my dialog csript

#NoTrayIcon

Dim $Message1

Dim $Message2

Dim $Message3

Dim $Title

$Title = "test here"

$Message1 = "test here"

$Message2 = "test here"

$Message3 = "test here"

MsgBox(266304,$Title,$Message1 & @CRLF & $Message2 & @CRLF & $Message3)

can you add to it to make it run a file at C:\"thefilename"

then post it and i will change the file name so it runs the right one

#NoTrayIcon

Dim $Message1
Dim $Message2
Dim $Message3
Dim $Title

$Title = "test here"
$Message1 = "test here"
$Message2 = "test here"
$Message3 = "test here"

MsgBox(266304,$Title,$Message1 & @CRLF & $Message2 & @CRLF & $Message3) $ Run ("COMPLETE FILE PATH HERE")

Use the autoit helpfile. It's easy to use, and will tell you everything you need to know.


Share this post


Link to post
Share on other sites

hmm i added the ( and ) as you said but it came up with an error saying

Run (C:\THE FILE NAME.exe

Run (C^ ERROR

Share this post


Link to post
Share on other sites

hmm i added the ( and ) as you said but it came up with an error saying

Run (C:\THE FILE NAME.exe

Run (C^ ERROR

Quotes.

I made this as easy as possible for you, and yo ustill messed it up.


Share this post


Link to post
Share on other sites

Okay, I have to ask, wtf is up with this line?

MsgBox(266304,$Title,$Message1 & @CRLF & $Message2 & @CRLF & $Message3) $ Run ("COMPLETE FILE PATH HERE")
That's not valid code at all.

Share this post


Link to post
Share on other sites

You need to do with quotes, other the compiler guess you use a variable.

And each command, each got a own line


-jaenster

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  
Followers 0