Jump to content
Sign in to follow this  
abc123

Newbie.. Need Help!

Recommended Posts

abc123

How can i use the argument received from another *.exe in a MsgBox? :shocked:

Can anyone please help me!

Share this post


Link to post
Share on other sites
Jos

How can i use the argument received from another *.exe in a MsgBox? :shocked:

Can anyone please help me!

$CMDLINE[] ?

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
abc123

Can you give me an example script please?! THANKS :shocked:

Share this post


Link to post
Share on other sites
Jos

Can you give me an example script please?! THANKS :shocked:

There are examples enough in helpfile and forum .....

Just search for some :(


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
abc123

I can't find any, they are much different than what i am looking for. Can you please quickly give me an example or anyone?!

Share this post


Link to post
Share on other sites
abc123

I want to send a string of text to a .exe created with AutoIt and i want to display the string of text in a MsgBox

Share this post


Link to post
Share on other sites
SpookMeister

Look at the Command Line Parameters section of the Running Scripts part of the help file.

Here is the on-line version

http://www.autoitscript.com/autoit3/docs/intro/running.htm


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites
SleepyXtreme

What i have done in the past is use the iniwrite function then the ini read function.

so the first .exe writes it and the second .exe reads it. ie the following:

FIRST .EXE

IniWrite("C:\Temp\myfile.ini", "section2", "key", "MESSAGE!!!!!")

SECOND .EXE

$var = IniRead("C:\Temp\myfile.ini", "section2", "key", "NotFound")

MsgBox(4096, "Result", $var)

Share this post


Link to post
Share on other sites
PsaltyDS

Both programs need to access something in common. Some examples you can find easily by searching this forum:

1. Shared file (like INI file mentioned earlier)

2. Shared registry setting

3. Shared memory access (complicated and advanced, but doable)

4. Shared network port (TCP or UDP)

5. Shared GUI info

I recently posted an example of number 5, Shared GUI info, to the Example Scripts part of the forum: Using GUI Controls for interprocess comms

:shocked:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
SadBunny

Well what exactly do you mean by "the argument received from another *.exe" anyway? You mean the other exe has some text somewhere you want to capture? Is the other exe also an autoitscript written by you?

If you want it to be something like this:

1. used command: "myexe.exe abcde" --> 2. display a msgbox with "abcde" in it

... then you use the CmdLine[]. Compile the following to an exe and run it with the abovementioned command

msgbox(0,"test",$CmdLine[1])

If you mean to do something else then please give some more info about what the first and the second exe are and do, that would make it easier to give you suggestions.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites
abc123

Well what exactly do you mean by "the argument received from another *.exe" anyway? You mean the other exe has some text somewhere you want to capture? Is the other exe also an autoitscript written by you?

If you want it to be something like this:

1. used command: "myexe.exe abcde" --> 2. display a msgbox with "abcde" in it

... then you use the CmdLine[]. Compile the following to an exe and run it with the abovementioned command

msgbox(0,"test",$CmdLine[1])

If you mean to do something else then please give some more info about what the first and the second exe are and do, that would make it easier to give you suggestions.

I have an .exe that does the following the following function:

File.Run (

string Filename,

string Args = "",

string WorkingFolder = "",

number WindowMode = SW_SHOWNORMAL,

boolean WaitForReturn = false )

result = File.Run("MyProg.exe", "Hello", "", SW_SHOWNORMAL, false);

The MyProg.exe is created with autoit. I want the autoit to display the "Hello" in a MsgBox, is that possible if it is can i send multiple e.g. "Hello/Bye"

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.