Jump to content

Recommended Posts

Posted

Hi, im trying to get autoit to write commands to the cmd prompt based on variables that i defined within autoit.

such as,

CODE
$dir = dir

$help = help

$tree = tree

and more complex ones with switches,

$tracert = tracert -d -h 25

or varible that can be used for more than one purpose,

$hostip = 127.0.0.1

$root = C:\

The ultimate purpose is to create a gui-based system for performing lengthy command line procedures.

Example:

CODE
$start = run (@ComSpec & " /c application and switches defined by $var")

im really not sure if its even possible...

the only method i've come up with is having autoit write the lines to a bat. file then executing that bat. file,

but naturally i would like to remove that extra step and make the gui more of an "all in one" utility, because that was the goal from the start.

So a little help for this noob would be greatly appreciated. thx.

Posted

I read the code and immediately catch a basic syntax error..

$start = run (@ComSpec & " /c application and switches defined by $var")

should be :

$start = run (@ComSpec & " /c ....." & $var)

you are mixing variables with strings, @comspec is a macro, "between these quotes is string" and every keyword preceded by a $ sign is a variable.

these need to be added up using the "&" character..

Posted

I read the code and immediately catch a basic syntax error..

$start = run (@ComSpec & " /c application and switches defined by $var")

should be :

$start = run (@ComSpec & " /c ....." & $var)

you are mixing variables with strings, @comspec is a macro, "between these quotes is string" and every keyword preceded by a $ sign is a variable.

these need to be added up using the "&" character..

right, sorry i was just typing that for basic reference

i didn't intend for it to be taken as the literal syntax

of course i would make that actual script with the proper syntax

Posted

Check the Help file for StdinWrite(), StderrRead(), and StdoutRead() functions.

thanks those worked how i wanted

i cant believe with all the searching i did i wasn't able to find them

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
×
×
  • Create New...