Elkie Posted March 2, 2006 Posted March 2, 2006 I Wanna use PSTools along with AutoIT so i can use the PSInfo for my project, but how can i get the info from the running PSinfo.exe or how can i retrieve output from PStools?? anyone can help me please
Marc Posted March 2, 2006 Posted March 2, 2006 You can redirect the output from almost any console application into a file. Short example, just hacked it along without testing it #include <process.au3> $result = _RunDOS("psinfo >" & @TempDir & "\result.txt") If $result = 0 Then $file = FileOpen(@TempDir & "\result.txt", 0) While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop Msgbox(0,"Line", $line) Wend Endif Hope this helps Marc Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)
Elkie Posted March 2, 2006 Author Posted March 2, 2006 awesome, it works thanks alot man. Now just need top figure out how to take only those values to display 'em on each textbox, got any idea?
Marc Posted March 2, 2006 Posted March 2, 2006 The resulting file does always have the same format so you can skip the first 4 Lines and to reach the interesting lines. After that I'd suggest something like this (as always, untested ^^) $position = StringinStr($line,":") $description = StringStripWS(Stringleft ($line, $position),7) $value = StringStripWS(StringMid($line, $position+1),7) to find the ":" in each line and split the entrys into description and value. Due to the StringstripWS all additional spaces are removed. Now you'll have to put these entries into the listboxes and continue till the end of the file best regards Marc Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)
Elkie Posted March 2, 2006 Author Posted March 2, 2006 K k i'm gonna give a try, thanks again for the help mate!!!
trids Posted March 2, 2006 Posted March 2, 2006 Here's an example that doesn't use the GUI .. http://www.autoitscript.com/forum/index.ph...indpost&p=36258HTH
Elkie Posted March 3, 2006 Author Posted March 3, 2006 trids: am i missing something, i download the script and folow the directions but all of the output is just the result of net view?
mikeytown2 Posted March 3, 2006 Posted March 3, 2006 (edited) Another way is if you get the latest beta, you can get the output without any temp file. Look up the Run command in the beta help file, and if you want to see a different example check out Send/Check Email using SSL/TLS; POP3 & SMTP in my sig.EDIThere is a good simple example of what i'm talking abouthttp://www.autoitscript.com/forum/index.ph...ndpost&p=156124 Edited March 3, 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
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