ThomasQ Posted September 13, 2009 Share Posted September 13, 2009 Hi! Just a quick n00b question. How do I use autoit to type and send commands trough command prompt (CMD)? I'm just trying to encorperate one action in my script. Thanks in advance!! Link to comment Share on other sites More sharing options...
TurionAltec Posted September 14, 2009 Share Posted September 14, 2009 Hi!Just a quick n00b question. How do I use autoit to type and send commands trough command prompt (CMD)?I'm just trying to encorperate one action in my script.Thanks in advance!!What action are you trying to incorporate?You can use Run,Runwait, shellexecute, shellexecutewait directly to run any command outside of the CMD interpreter (ipconfig, netstat, etc).If it is an internal CMD command (copy, dir, etc) you can invoke the CMD interpreter with the @ComSpec macro:Run(@ComSpec & ' /k dir c:\', '', @SW_HIDE)Run(@ComSpec & ' /c dir c:\', '', @SW_HIDE)/k will keep cmd open when done with the command, /c will cause it to close.If you need to interact with a console app which uses standard input/output, look at run combined with $STDOUT_CHILD options, in conjunction with stdoutread, StdinWrite.Alternatively you can also blindly use "send" on an open console window. 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