Rogueelite Posted September 11, 2007 Share Posted September 11, 2007 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. Link to comment Share on other sites More sharing options...
ssubirias3 Posted September 11, 2007 Share Posted September 11, 2007 Check the Help file for StdinWrite(), StderrRead(), and StdoutRead() functions. Link to comment Share on other sites More sharing options...
lordofthestrings Posted September 12, 2007 Share Posted September 12, 2007 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.. Link to comment Share on other sites More sharing options...
Rogueelite Posted September 12, 2007 Author Share Posted September 12, 2007 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 referencei didn't intend for it to be taken as the literal syntaxof course i would make that actual script with the proper syntax Link to comment Share on other sites More sharing options...
Rogueelite Posted September 12, 2007 Author Share Posted September 12, 2007 Check the Help file for StdinWrite(), StderrRead(), and StdoutRead() functions.thanks those worked how i wantedi cant believe with all the searching i did i wasn't able to find them Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now