Jump to content

Client Commander


4Fun
 Share

Recommended Posts

I'm a newbie started using autoit a 1.5 months ago and wanted to give back. I'm new to programming so be kind and most of the code i used was created by someone here. Thanks for all the examples, everyone on this forum so helpful!

Leveraging your hard work I was able to create client/server that can send commands to multiple computers at once. It has some bugs, one with the TCP recieve and another that will lockup my computer if connect to more than ~20 computers are in the array (TCP related).

Commands that are currently supported: Query, ProcessExists, ProcessClose, WindowExists, WindowClose, Exec, CommandLine (this one is for batch file and work specific)

Query - returns OK and sets status 1 if computer responds.

Exec - uses the autoit Run() funtion on the client side.

I plan to use a inifile in the future for storing the computer names and other stuff. (Future update)

A variable ($Hosts) exists and has the @ComputerName in it so the computer your will atomatically be in the listview. Add more computers there if you want test on multiple systems. I also added a loop to add some extra dummy systems so the listveiw won't be empty and also for debug.

All feedback, ideas, criticisms and help are welcome!

7/24/06 - Updated Server and included compiled versions of the Server and Client

Appserver.zip

Edited by 4Fun
Link to comment
Share on other sites

Nice, check my signature for MANY things tcp related in my post. Also see my chat project at www.autoit-its.com

Edit 1 : After further checking it, the GUI is very laggy. There must be a 3 second delay before anything happens on the GUI. Was unable to connect to anything. A bit confusing, but shows general tcp knowledge. It is a good attempt. 2/5 stars. Once you learn some more efficency with GUI then it will go up quite a bit.

Edited by AutoIt Smith
Link to comment
Share on other sites

Did I help you? What example have you used? I need to know if I should make more examples incase they were confusing.

Edit 1 : Added "make more examples".

Edit 2 : Also I do thank you, I did not realize the beta was in 3.1.1.130, I was still using .109 and it ran an error because of GUIColumnHeader. I guess I need to scan a bit of the helpfile for changes :D.

Edit 3 : Try using an update button instead of auto-updating on startup. It would help it alot. I was confused at first when the GUI wouldn't move. :wacko: Lol

Edited by AutoIt Smith
Link to comment
Share on other sites

Did I help you? What example have you used?

I think I started with your TCP Communicator and used the text as the commands. Can't wait until I understand what I'm doing better and can't truely contribute.

Link to comment
Share on other sites

To get a better grip of it, you need:

1) Helpfile

2) Time

3) TCPMadeEasy ( Optional )

Documented and Located Here :

http://www.autoitscript.com/forum/index.ph...c=18738&hl=

It explains evreything the helpfile does, just very long and in an unneed way. Created for situations just like this. The only useable function is TCPStartServer because it allows you to forget about ipaddresses and only use ports and MaxConc. I do not recommend using these in the future, but for explaination it is great. For any help, just personal message me. It took me six months of fiddling to be able to use TCP while I was asleep.

Edited by AutoIt Smith
Link to comment
Share on other sites

To get a better grip of it, you need:

1) Helpfile

2) Time

3) TCPMadeEasy ( Optional )

Documented and Located Here :

http://www.autoitscript.com/forum/index.ph...c=18738&hl=

It explains evreything the helpfile does, just very long and in an unneed way. Created for situations just like this. The only useable function is TCPStartServer because it allows you to forget about ipaddresses and only use ports and MaxConc. I do not recommend using these in the future, but for explaination it is great. For any help, just personal message me. It took me six months of fiddling to be able to use TCP while I was asleep.

Thanks for the feedback! I work on it over the weekend - Got to go for now.

Edited by 4Fun
Link to comment
Share on other sites

I Added a new button to connect to the clients on the server and fixed a bug with the close window case on the client.

To use these scripts compile the Client and run on some computers on your network and/or the local system.

Run the server and select All from the combobox and press connect. It should aleast conect to the local computer.

Now select None and then Status=1 from the combobox and press Execute. It should show Connection OK.

Now select Exec form the second combobox and press execute. It should run Notepad and return the PID.

Now select Process Exists and enter the PID in place of notepad and press Exec.

Now select Process Closse and enter the PID in place of notepad and press Exec, it should close Notepad.

Note the PID will be different on each computer. For multiple computer use WindowExists and WindowClose commands for ease. Begining window will work but case sensitive.

Enjoy and let me know what you think. If you find it usefull but could additional functions let me know I may be able to add it. I will be adding labels later.

Link to comment
Share on other sites

From a quick scan i see that you are using files and GUI's in the server. I can seriously recommend you to get rid of the files and the GUI, because they will stress your server unnecesary. In stead of files, use arrays and in stead of GUI, use hotkeys and tooltips. Or preferably, nothing at all.

Too bad you copied (stolen?) most of the client.

Link to comment
Share on other sites

From a quick scan i see that you are using files and GUI's in the server. I can seriously recommend you to get rid of the files and the GUI, because they will stress your server unnecesary. In stead of files, use arrays and in stead of GUI, use hotkeys and tooltips. Or preferably, nothing at all.

Too bad you copied (stolen?) most of the client.

Stolen what from where?
Link to comment
Share on other sites

Stolen what from where?

I used code that many people posted and from the auto examples. That's how I learned to use AutoIt v3 and was the quickest way to get results. I would be honored if someone used code that I created (not likely to happen until I improve though) and I always try to give credit to those who helped me or whose code I used. If I use your code feel free to add you name to the header of the script. :D

The end-user at my work wanted the GUI and will I be adding error logging that is why the file is used. I will also add cmdline parameters to it that will bypass the GUI and allow other script to utilize this one.

Thanks for the feedback!

Edited by 4Fun
Link to comment
Share on other sites

  • 2 weeks later...

Yes this is fairly similar to my Remote Server except it works over the entire internet. Controlling a network doesn't really matter because you can just use a network address and it will work all the same. Check out my Remote Server. You may find it more useful then you may have originally thought.

Link to comment
Share on other sites

@GioVit

You may need to disable AntiVirus software. However the most likely problem is you need to start the server on the computer in the first place, and then find the PROPER ipaddress.

You can find a utility called IPScout on the ITS website that will get your physical address as well as your network address. If you are behind a firewall, router, or a Cable/DSL modem you will need to use your network address. Also make sure the connection port is correct.

http://www.autoit-its.com/autoit-its/downloads.cfm

Scroll down a bit. It's in the middle of the page.

1. Start Server

2. Connect to Network Address on Correct Port

3. Should Have No Problem

Link to comment
Share on other sites

why I get allways "Could not connect to remote computer" does it has to do with the antivirus protection of windows xp? may someone give me an idea of what wrong?

thanks in advance

Hey GioVit,

The first thing you need to do is run the client on each of the computers you would like to connect to using the server. Using a minimum of the local computer will give you at least one computer to connect to. Any other computers you can add them to the $Hosts variable followed by a comma (computername1,computername2,). If you are doing that and still not able to connect then a firewall could be the culprit. Make sure it will allow both programs to run and that port 50911 is open.

Hope that helps,

4Fun

Edited by 4Fun
Link to comment
Share on other sites

@AutoIt Smith

Many Thanks

In this forum people can find more than only good and fast answers.

Thanks to all members of this forum too.

@AutoIt Smith,

Thanks for helping :whistle:

@GioVit

Hope you find this useful although it not completely functional yet.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...