Jump to content
Sign in to follow this  
masonje

pass variable to .exe script

Recommended Posts

masonje

How do I execute an autoit script that looks like this...

Dim $t

MsgBox(0, "test", $t)

...then I want to run it with a statement something like...

test.exe $t="Jon"

...I know that does not work, but I'm sure there is some way. I looked through the documentation, but couldn't find it. I'm sure I just wasn't looking for the right key words.

Thanks,

MasonJE

Share this post


Link to post
Share on other sites
gamerman2360

If you have something like 'test.exe $t="Jon"' run. There is a var $CmdLine[0] that will be set to 1 and $CmdLine[1] will be set to '$t="Jon"'... In the helpfile look up command line parameters.

[edit]

Added quotes.

Edited by gamerman2360

Share this post


Link to post
Share on other sites
Valuater

heres an example

; Command Line decompile to desktop
; Author Skruge

If $CMDLine[0] > 0 Then
      If $CMDLine[1] = "/decompile" Then GetSource()
  EndIf
  
; Main Code Here
  
  Func GetSource()
      FileInstall("MyScript.au3", @DesktopDir &  "\")
      Exit
  EndFunc ;==>GetSource

and the syntax would be

"myprogram.exe /decompile"

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
masonje

$CMDLine[1] = "/decompile"...

"myprogram.exe /decompile"

That was exactly what I was looking for. Thanks a tun! :P

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.