WhiteAvenger Posted August 28, 2008 Share Posted August 28, 2008 Hi, is it possible in AutoIt to recognise when a script is being called from the command line (cmd.exe)? And if yes, can you output text into the cmd.exe that called the script? --WhiteAvenger Link to comment Share on other sites More sharing options...
Andreik Posted August 28, 2008 Share Posted August 28, 2008 Hi, is it possible in AutoIt to recognise when a script is being called from the command line (cmd.exe)? And if yes, can you output text into the cmd.exe that called the script? --WhiteAvenger Yes you can get data from cmd.exe An example to get data from cmd.exe: #include <Process.au3> Func DOS_STDOUT($LINE) _RunDOS($LINE & " >" & @TempDir & "\STD_OUT.TXT") Local $FILE = FileOpen(@TempDir & "\STD_OUT.TXT",0) Local $OUTPUT = FileRead($FILE) FileClose($FILE) Return $OUTPUT EndFunc MsgBox(0,"",DOS_STDOUT("VER")) When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Zonarius Posted August 28, 2008 Share Posted August 28, 2008 (edited) As far as I know it's not possible to recognise if cmd.exe started the program. It's also not possible to display text on console. But you can send it without displaying. Use ConsoleWrite for this. for example: ;hw.au3 ConsoleWrite("hello world!")oÝ÷ ØÚ0ʦºË¢jbëaz趦bjw±yËz+eG+!Áì^Ú.¶·X¢ì"WâØ^Z0¢¹]ßx§¢ëiºÛq´z)x(ºWazZDÈë-~§v¶Êjwb²ZÉɵìmo+¬x-à.¶-ÝjÚ¦«jëh×6#AutoIt3Wrapper_Change2CUI=y ConsoleWrite("Hello World!") Edited August 28, 2008 by Zonarius Link to comment Share on other sites More sharing options...
carlosa Posted September 19, 2008 Share Posted September 19, 2008 As far as I know it's not possible to recognise if cmd.exe started the program. It's also not possible to display text on console. But you can send it without displaying. Use ConsoleWrite for this. for example: ;hw.au3 ConsoleWrite("hello world!")oÝ÷ ØÚ0ʦºË¢jbëaz趦bjw±yËz+eG+!Áì^Ú.¶·X¢ì"WâØ^Z0¢¹]ßx§¢ëiºÛq´z)x(ºWazZDÈë-~§v¶Êjwb²ZÉɵìmo+¬x-à.¶-ÝjÚ¦«jëh×6#AutoIt3Wrapper_Change2CUI=y ConsoleWrite("Hello World!")thanks a bunch this is exacly what i was looking for i feel like a man now ! Carlos AnguianoSenior Technical Director/Pipeline EngineerRed magnet Studios Venice, CAhttp://www.redmagnetfx.com Link to comment Share on other sites More sharing options...
trancexx Posted September 19, 2008 Share Posted September 19, 2008 As far as I know it's not possible to recognise if cmd.exe started the program....SmOke_N would disagree ♡♡♡ . eMyvnE 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