Sign in to follow this  
Followers 0
bradvexille

Sending Text To Cmd In The Background?

5 posts in this topic

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

Share this post


Link to post
Share on other sites



omg! a 100% helpful reply in 7 minutes at midnight!?!?

is that a record? :whistle:

thank you very much!

brad

Share this post


Link to post
Share on other sites

omg! a 100% helpful reply in 7 minutes at midnight!?!?

is that a record?  :whistle:

thank you very much!

brad

If it's a record, it's probably for being slow...

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0