ptrex Posted June 2, 2006 Share Posted June 2, 2006 Is in some way possible to grab the output of the cmd window of another host. Without using some kind of temp files to store the data in ? PSExec is an option but still it doesn't give the output to AutoIT, unless over a temp file. I need a way to of direct access, as if I was running it locally. Thanks Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
JMiller Posted June 4, 2006 Share Posted June 4, 2006 (edited) Is in some way possible to grab the output of the cmd window of another host. Without using some kind of temp files to store the data in ? PSExec is an option but still it doesn't give the output to AutoIT, unless over a temp file. I need a way to of direct access, as if I was running it locally. Thanks I think psexec in combination with StdOutRead() would work. There is information about this command and an added parameter to Run() in the beta help file. Also, here is an example of it being used. Script Hmm actually i'm not sure if that would work... because psexec would spawn the child process, but that information would not necessarily be returned to the psexec process. I'll try testing it. Edit: psexec seems to contain the output from the command. I didn't have another pc handy to test remote execution, but it should work like the following code. One thing that I found is you have to terminate the psexec.exe process for some reason before the script continues. So, you'd have to find a delay that gives the command long enough to run without slowing your script down too much... _psexecTest() Func _psexecTest() Local $ipconfig = Run("psexec.exe -s ipconfig.exe", "", @SW_HIDE, 2) Local $data = "" Sleep(1000) ProcessClose("psexec.exe") While 1 $data &= StdOutRead($ipconfig) If @error = -1 Then ExitLoop WEnd MsgBox(0, "Test", $data) EndFunc Edited June 4, 2006 by JMiller Link to comment Share on other sites More sharing options...
herewasplato Posted June 4, 2006 Share Posted June 4, 2006 ...Without using some kind of temp files to store the data in ?...Well not with that condition :-) 'cuz even the std I/O functions create tmp file(s)... which (BTW) are left behind if the script terminates abnormally.It might us help to know what you are attempting to run in that remote CMD window. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
ptrex Posted June 6, 2006 Author Share Posted June 6, 2006 Thanks for all the feedback. The application I am trying to run is some command line tool that belongs to our ERP system. Which is not standard used everywhere. So replicating this whould be hard on your side. the thing with this tool is that i can only be run at the server side, not from any client. I need to grab the output from the CMD box to the client. I know I can to do with a temp file but I would prefer not to. Any idea's are welcome. Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
DaveF Posted June 6, 2006 Share Posted June 6, 2006 Well not with that condition :-) 'cuz even the std I/O functions create tmp file(s)... which (BTW) are left behind if the script terminates abnormally. StdoutRead/StderrRead/StdinWrite? Uh, no they don't, unless you consider your virtual memory swap file a temp file... Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines. Link to comment Share on other sites More sharing options...
herewasplato Posted June 30, 2006 Share Posted June 30, 2006 StdoutRead/StderrRead/StdinWrite? Uh, no they don't, unless you consider your virtual memory swap file a temp file...As you can see, I don't get to this forum much.If you are able to use the StdoutRead/StderrRead/StdinWrite functions without temp files being created, then I must have coded something wrong in this post:http://www.autoitscript.com/forum/index.ph...st&p=173643If you remove the last line of that code FileDelete("C:\Temp\scs???.tmp") you should have three temp files in the OS temp folder after running that code. They are just text files and they contain everything that the CMD screen would have displayed to the user including the info being sent from the script to the CMD window. [size="1"][font="Arial"].[u].[/u][/font][/size] 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