bradvexille 0 Posted February 13, 2004 Share Posted February 13, 2004 Run(@comspec & " /c " & $D2Path, "", @SW_HIDE) that works, for running a shortcut, and i was hoping to use the same method to open the CMD window, send text to it, and close it.. what needs to be sent is: netstat -n | find "4000" > CurrentServer.txt it will let the script know what IPs it is connected to on port 4000, if any.. it works just fine manually, if i run cmd, type it in, hit enter, and close cmd.. but being able to just use the command, especially while cmd is completely hidden would really make this script far more efficient.. unfortunately, i have been unable to just plug that in instead of the /c etc.. any help or ideas would be greatly appreciated thanks, brad Link to post Share on other sites
CyberSlug 6 Posted February 13, 2004 Share Posted February 13, 2004 Wrap it in a user-defined function: _RunCmd('netstat -n | find "4000" > CurrentServer.txt') Func _RunCmd( $command ) Return RunWait( @ComSpec & " /C " & $command, "", @SW_HIDE ) EndFunc Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to post Share on other sites
bradvexille 0 Posted February 13, 2004 Author Share Posted February 13, 2004 omg! a 100% helpful reply in 7 minutes at midnight!?!? is that a record? thank you very much! brad Link to post Share on other sites
Valik 481 Posted February 13, 2004 Share Posted February 13, 2004 omg! a 100% helpful reply in 7 minutes at midnight!?!?is that a record? thank you very much!bradIf it's a record, it's probably for being slow... Link to post Share on other sites
scriptkitty 1 Posted February 13, 2004 Share Posted February 13, 2004 (edited) why not try: Run(@comspec & ' /c netstat -n > c:\CurrentServer2.txt', ""); this works fine for me this is about what you said Run(@comspec & ' /c netstat -n | find "4000' > CurrentServer.txt", "", @SW_HIDE); I think it might be this though Run(@comspec & ' /c netstat -n 4000 > CurrentServer.txt', "", @SW_HIDE); The file didn't write on the ones where I called out an interval, just like when it was in the command line. edit...Dang I guess I write slow... Edited February 13, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Link to post Share on other sites
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