Jump to content

Run() and multi veriables...


KXM
 Share

Recommended Posts

I'm having a problem running more than one variable.

I'm not great at programming, and sorry if this is laughable.

I'm sure it's only a matter of formatting, but can't figure out where. I've looked over the .chm, and done some searching on the forums here, but think this is so basic, no one has asked. :idiot:

Any hints?

Dim $test1 = "D:\Profiles\Programing\AutoIt\Concepts\"
Dim $test2 = "M2B.exe"

;Run($test1 & $test2)
MsgBox(4096, "none", ""& $test1 & $test2)

Basically I'd like Run to perforum the same as MsgBox.

TIA,

Neil

Edited by KXM
Link to comment
Share on other sites

Run is already defined, so you can't use this. I'm sure some guru on here will lecture about scope and global and what not, but for a starter, you can do something like this:

Dim $test1 = "D:\Profiles\Programing\AutoIt\Concepts\"
Dim $test2 = "M2B.ini"

MyRun()
;MsgBox(4096, "none", ""& $test1 & $test2)

Func MyRun ()
   MsgBox(4096,"None", $test1 & $test2)
EndFunc
Link to comment
Share on other sites

  • Developers

I'm having a problem running more than one variable.

I'm not great at programming, and sorry if this is laughable.

I'm sure it's only a matter of formatting, but can't figure out where. I've looked over the .chm, and done some searching on the forums here, but think this is so basic, no one has asked.  :idiot:

Any hints?

Dim $test1 = "D:\Profiles\Programing\AutoIt\Concepts\"
Dim $test2 = "M2B.exe"

;Run($test1 & $test2)
MsgBox(4096, "none", ""& $test1 & $test2)

Basically I'd like Run to perforum the same as MsgBox.

TIA,

Neil

<{POST_SNAPBACK}>

Should work... are you sure about your pathname ? (i see programing.. maybe that should be programming ?)

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

Thanks for the fast reply, but I should have gave a better example.

I only need to know how to use 'Run' correctly, I put the MsgBox in as an example of how I was able to get 2 variables to run correcly togeather.

Really what I can't figure out is how to do this:

Dim $1 = "C:\"
Dim $2 = "myprogram.exe"

Run($1, $2)
Link to comment
Share on other sites

Thanks for the fast reply, but I should have gave a better example.

I only need to know how to use 'Run' correctly, I put the MsgBox in as an example of how I was able to get 2 variables to run correcly togeather.

Really what I can't figure out is how to do this:

Dim $1 = "C:\"
Dim $2 = "myprogram.exe"

Run($1, $2)

<{POST_SNAPBACK}>

If it's just an executable with no command line parameters:

Dim $s1 = "C:\"

Dim $s2 = "myprogram.exe"

Run($s1 & $s2)

If there are command line parameters, put a space between the executable and the parameter.

$s3 = "C:\test.ini"

Run($s1 & $s2 & " " & $s3)

If the file name or path contains spaces, the string must be enclosed in quotes. In the following example, there is an apostrophy and a quote combination at each end of the string.

Run('"c:\program files\My Prog\abc.exe"')

or to use variables

Run('"' & $s1 & $s2 & '"')

See the AutoIt help file for the optional Run parameters.

I hope this helps you.

Phillip

Link to comment
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
 Share

  • Recently Browsing   0 members

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