mikeytown2 Posted February 18, 2006 Share Posted February 18, 2006 (edited) MOVED TOhttp://www.autoitscript.com/forum/index.php?showtopic=21889This sends out an email using a gmail account. It connects to the sever with OpenSSL using TLS or Transport Layer Security. In order to get this script to run you need to grab opensslhttp://www.openssl.org/related/binaries.htmlOr (its the same)http://www.slproweb.com/download/Win32OpenSSL-v0.9.8a.exeand then copy the _Base64.au3 and the ssl.au3 into C:\OpenSSLThis program redirects the cmd output to a txt file and then sends input back into the cmd window. Got the info on how to do this from herehttp://www.microsoft.com/resources/documen...edirection.mspxSo yes this does read the output from the command line in "real time", some said it couldn't be done... anyway if i could somehow get this hide processes method to work as well, then I think this could be quite useful.http://www.autoitscript.com/forum/index.ph...98entry150198I put in a link from Microsoft, in this thread, on how to hide processes using VBscript. I want to hide cmd.exe from the taskbar but still have the gui active (@SW_HIDE doesn't work, i can't use Send()).But my main question is why isn't this working? it appears that openssl is flaking out on me... any ideas?You need to fill in some variables to test this.EDIT this example code again, files are the sameHere is the code to make it read the command line output. It appears that some commands like netstat dont output till the buffer is full, where as the openssl flushes the buffer... just some intersting points. to kill netstat from the command line use CRTL Pause. CRTL C doesn't work for some reason.expandcollapse popup#include <file.au3> #include <Array.au3> opt("OnExitFunc", "endscript") opt("WinTitleMatchMode", 2) ;kill previous run While ProcessExists("cmd.exe") ProcessClose("cmd.exe") WEnd GUICreate("Command Trace",660,400) $mylist=GUICtrlCreateEdit("", -1,-1, 660, 400) ;set files $Command = "netstat -a -o 5";this is the command to run $tempFileA = "output.txt" $tempFileB = "run.bat" ;clean up from last run FileDelete($tempFileB) FileDelete($tempFileA) ;write bat file $file = FileOpen($tempFileB, 2) FileWriteLine($file, $Command) FileClose($file) ;run bat with output sent to $tempFileA Run($tempFileB & ' >' & $tempFileA) ;wait for window to popup WinWait(@SystemDir & "\cmd.exe") Dim $aArray ;$aArray = "" ;_FileReadToArray($tempFileA, $aArray) $FileSized = 0 ;###HIDES THE WINDOW### comment this line out to see the cmd window ;WinMove(@SystemDir & "\cmd.exe", "", @DesktopWidth, @DesktopHeight) GUISetState () ;set var's $State_R = 0 $FileLineStart = 0 $new = 0 While 1 _FileReadToArray($tempFileA, $aArray) $new = 0 ToolTip(UBound($aArray) - 1 & @CRLF & $FileSized) While $FileSized < UBound($aArray) - 1 _SmtpTrace($aArray[$FileSized]) $new = 1 $FileSized = $FileSized + 1 WEnd If $new = 1 Then For $i = $FileLineStart To UBound($aArray) - 1 Step + 1 If StringInStr($aArray[$i], "autoitscript") And $State_R = 0 Then WinActivate(@SystemDir & "\cmd.exe") WinWaitActive(@SystemDir & "\cmd.exe") MsgBox(0,"Example", "Go you!") $State_R = 1 $FileLineStart = $i + 1 ElseIf StringInStr($aArray[$i], "More Output") And $State_R = 1 Then WinActivate(@SystemDir & "\cmd.exe") WinWaitActive(@SystemDir & "\cmd.exe") Send("Another Command{ENTER}") $State_R = 2 $FileLineStart = $i + 1 EndIf Next EndIf Sleep(250) WEnd Func _SmtpTrace($s_DisplayString, $i_Timeout = 0) GUICtrlSetData($mylist,$s_DisplayString & @CRLF, 1) EndFunc;==>_SmtpTrace Func endscript() $s = MsgBox(4, "Kill Child Processes?", "Do you want to kill the command prompt?") If $s = 6 Then While ProcessExists("cmd.exe") ProcessClose("cmd.exe") WinClose(@SystemDir & "\cmd.exe") WEnd EndIf EndFunc;==>endscriptWell i hope my lure works... check out the rest of the codessl.au3 Edited February 22, 2006 by mikeytown2 Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
mikeytown2 Posted February 18, 2006 Author Share Posted February 18, 2006 (edited) I found some c++ Code that redirects all command Input/Output to its gui... its only a 18k exe as well.http://www.codeproject.com/dialog/quickwin.aspI wonder if autoit can do this? i peeked at the code it just makes handles to redirect the output into a buffer in memory... It looks like i could do this by using file handles, but I'm not so sure about the input, I'm all ready doing this for the output.Any help?MOVED TOhttp://www.autoitscript.com/forum/index.php?showtopic=21889 Edited February 19, 2006 by mikeytown2 Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack Link to comment Share on other sites More sharing options...
darren Posted February 19, 2006 Share Posted February 19, 2006 Hi - Can we use this as the basis for a gmail notifier replacement.... ? 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