Sign in to follow this  
Followers 0
bobuk

Compile exe allowing input

5 posts in this topic

I am new to autoit but have been using vbscript for a while. I need some help with this.

I want to use the RunAsSet and compile it as an executable but I would like the executable to take some varialbles, if possable.

IE: AppInstall.exe -PATH -PASSWORD

where:- PATH = path of executable to run

PASSWORD = of user with rights to install

RunAsSet("adminuser", @Computername, "PASSWORD")

RunWait('PATH')

RunAsSet()

Share this post


Link to post
Share on other sites



Hi bobuk,

Command Line Parameters.

; Check $CMDLINE[0] for parameter count
If $CMDLINE[0] = 2 Then
    ; Assign 1st parameter to $path
    $path = $CMDLINE[1]
    ; Assign 2nd parameter to $password 
    $password = $CMDLINE[2]
    ;
    RunAsSet("adminuser", @Computername, $password)
    RunWait($path)
    RunAsSet()
EndIf

$CMDLINE is reserved for incoming parameters and used as an array. Test against $CMDLINE[0] for array count before attempting to use the array.

:D

Share this post


Link to post
Share on other sites

Hi bobuk,

Command Line Parameters.

; Check $CMDLINE[0] for parameter count
If $CMDLINE[0] = 2 Then
    ; Assign 1st parameter to $path
    $path = $CMDLINE[1]
    ; Assign 2nd parameter to $password 
    $password = $CMDLINE[2]
    ;
    RunAsSet("adminuser", @Computername, $password)
    RunWait($path)
    RunAsSet()
EndIf

$CMDLINE is reserved for incoming parameters and used as an array. Test against $CMDLINE[0] for array count before attempting to use the array.

:D

Thanks, wow, it is so easy. I think I will be using AutoIT more and more.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

That is OK. I would recommend AutoIt along with your VBScript use. You can make use of AutoitX.dll that comes along with the standard AutoIt install to enhance your VBScripts where needed also.

Ensure you get yourself a copy of the Beta AutoIt Installer which has Com, ActiveX and StdOutRead/InWrite handling added.

:D

Edit: In case Nutster reads this, Autoit Beta has inbuilt Regular expressions support and all the rest I may have failed to credit. :D

Edit2: Out and In as in summary above for STD?Read/?Write...

Edited by MHz

Share this post


Link to post
Share on other sites

Edit: In case Nutster reads this, Autoit Beta has inbuilt Regular expressions support...

WOOHOO!

;):D:P:D:evil:

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