sonofalion Posted November 5, 2008 Share Posted November 5, 2008 Hi, I am making a program that opens a command prompt (hidden) and then runs PuTTY. The code is like this: $cmd_win = @ComSpec $pid = Run($cmd_win, "C:\") If @error Then Exit MsgBox(0, "Error PID", $pid) Sleep(500) ControlSend('[CLASS:ConsoleWindowClass]', '', '', 'cd "Program Files\Putty"' & '{ENTER}') Sleep(300) ControlSend('[CLASS:ConsoleWindowClass]', '', '', 'putty.exe -telnet 213.249.17.139' & '{ENTER}') I want to have the PuTTY window start hidden as well. Is this possible? I tried using WinSetState ('[CLASS:PuTTY]', '', @SW_HIDE) right after the last line, but still I get the PuTTY window for a second or so before it hides... (Don't ask me to start PuTTY directly, without using the command line. When I do this, the logging feature of PuTTY doesn't work for some reason...) Paris Link to comment Share on other sites More sharing options...
Marlo Posted November 5, 2008 Share Posted November 5, 2008 Why not just run this "putty" using the shellexecute function? Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
sonofalion Posted November 5, 2008 Author Share Posted November 5, 2008 Why not just run this "putty" using the shellexecute function?Because, as I said in the previous post, PuTTY logging does not work when you do that. And I want it to work. Link to comment Share on other sites More sharing options...
torels Posted November 5, 2008 Share Posted November 5, 2008 did you use WinWaitActive('[CLASS:PuTTY]', '', @SW_HIDE) and then WinSetState ('[CLASS:PuTTY]', '', @SW_HIDE) ? Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org Link to comment Share on other sites More sharing options...
senthor Posted November 5, 2008 Share Posted November 5, 2008 (edited) Try the following: #include <constants.au3> $a = Run('"C:\Program Files\Putty\putty.exe" -telnet 213.249.17.139', "C:\Program Files\Putty", @SW_HIDE, $STDERR_CHILD+$STDOUT_CHILD) local $t While Not @error $t &= StdoutRead($a) WEnd Msgbox(0,"",$t)oÝ÷ ÚÚºÚ"µÍ[ÛÛÜXÈ [È ÌÎNÈÐÈ ][ÝÐÎÌLÔÙÜ[H[ÉÌLÔ]IÌLÜ]K^I][ÝÈ][]LËKMËLÎIÌÎNË ][ÝÐÎÌLÔÙÜ[H[ÉÌLÔ]I][ÝËÝ×ÚYJBÚ[ØZ]XÝ]J ][ÝÖÐÓTÔÎUWI][ÝÊBÚ[Ù]Ý]J ][ÝÖÐÓTÔÎUWI][ÝËÕ×ÒQJ senthor Edited November 5, 2008 by senthor FileListToArray UDFMy tools 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