Sign in to follow this  
Followers 0
tironci

how to get parameters with autoit

3 posts in this topic

Hi

i am trying to write a script that takes a parameter from a vbscript and then goes on and checks that parameter and does the conversions it is supposed to do.

i have looked in the help file and i cant find an example on how to call the autoit .exe from the vbscript file. could someone please help.

this is the code

CODE
$edition = 0

If $CmdLine[0] = 1 Then

$edition = $CmdLine[1]

EndIf

If $edition = 'Developer' Then

; Run Deverloper and convert all the Report Batches, Reports and Dashboards

Run("C:\Program Files (x86)\\\.exe"); path where .exe file is located

Sleep(5000)

report($edition)

ElseIf $edition = 'Developerx86' Then

Run("C:\Program Files (x86)\\\.exe") ;path to where the .exe file is located

ElseIf $edition = 'officex86' Then

Run("C:\Program Files (x86)\\\.exe")

EndIf

Func Report($editions)

all i want to get from the vbscript is on parameter which gives the name of the edition.

this is what i have but this only opens the converter0.3.exe

CODE
dim shell

set shell=createobject("wscript.shell")

shell.run "C:\Users\dh\Desktop\automation\conversion0.3.exe"

set shell=nothing

any help is appreciated.

Share this post


Link to post
Share on other sites



Command Line Parameters have a section in the help file. Use the special variable $CmdLine[0],$CmdLine[1],$CmdLine[2] ect for each paramater.

Share this post


Link to post
Share on other sites

Hi

i am trying to write a script that takes a parameter from a vbscript and then goes on and checks that parameter and does the conversions it is supposed to do.

i have looked in the help file and i cant find an example on how to call the autoit .exe from the vbscript file. could someone please help.

this is the code

CODE
$edition = 0

If $CmdLine[0] = 1 Then

$edition = $CmdLine[1]

EndIf

If $edition = 'Developer' Then

; Run Deverloper and convert all the Report Batches, Reports and Dashboards

Run("C:\Program Files (x86)\\\.exe"); path where .exe file is located

Sleep(5000)

report($edition)

ElseIf $edition = 'Developerx86' Then

Run("C:\Program Files (x86)\\\.exe") ;path to where the .exe file is located

ElseIf $edition = 'officex86' Then

Run("C:\Program Files (x86)\\\.exe")

EndIf

Func Report($editions)

all i want to get from the vbscript is on parameter which gives the name of the edition.

this is what i have but this only opens the converter0.3.exe

CODE
dim shell

set shell=createobject("wscript.shell")

shell.run "C:\Users\dh\Desktop\automation\conversion0.3.exe"

set shell=nothing

any help is appreciated.
Since my knowledge of vbscript is close to zero I probably shouldn't even answer, but I think it should be as simple as

dim shell
set shell=createobject("wscript.shell")
shell.run """C:\Users\dh\Desktop\automation\conversion0.3.exe"" ""Developer"""
set shell=nothing

(the quotes are x3 then x2 then a space then x2 then x3)


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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