Jump to content

How can I run a autoit command through a variable? Thanks!


CrewXp
 Share

Recommended Posts

How can I run a autoit command through a variable? I'm trying to send an autoit command via a variable to a remote pc via tcp. The remote pc is running a listen script. I don't know what to put in the listen script to make it do the autoit command in teh variable once it receives it. Thanks!

Link to comment
Share on other sites

Well you can't send a command. But you can use Execute() to get strings to work. But it's limited, alot! If you wanted you could make a really complex script that writes a file.au3 with a few comands and run it. Then develop a way to send the command to the receiving computer that writes the file into a temp folder or something....

PS: Why all these questions that sound like hacking scripts, lol.

Edited by gamerman2360
Link to comment
Share on other sites

lol hacking, right. Anyways, yea. I have 30 workstations in the room. My computer is setup to allow each one to do different things when they request it. It's setup so they can click a button to view a special program, it writes a variable to an ini, my program checks for the variable every ten seconds, if it finds it, i can etc etc.

But it would be way easier with tcp. I can send messages to them, take screen shots of their computer, so I know they're working, and manage things easier really. But yea

So does anyone know how I can make it work?

Link to comment
Share on other sites

So does anyone know how I can make it work?

Yes. There are plenty of members who know how to make it work.

Search the forums for examples using TCP functions.

Do your best to understand them and integrate them with your code.

When you get stuck, post your code here.

Good luck!

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Link to comment
Share on other sites

umm Skruge... ok...

The problem is, I don't know the code.

If I just put $msg on a line by itself, it gives a parse error. I've tried putting "$msg" too, but it doesn't work. I'm sure there's an easy way, I'm just asking.

..Skruge..

Link to comment
Share on other sites

Maybe search "Command" in help

I don't have a direct answer. and i dont know what you mean by an Autoit " command "....??

I think this...

It's setup so they can click a button to view a special program, it writes a variable to an ini, my program checks for the variable every ten seconds, if it finds it, i can etc etc.

is one of the best systems to send info to another compuetr

however see command in help

8)

NEWHeader1.png

Link to comment
Share on other sites

The approach I would follow is something along these lines:

  • Determine a definitive list of what functions the 'slave' computers should offer to the 'master' computer (for lack of better terms).
  • Determine how the needs of these functions could be communicated -- for instance, some functions wouldn't require any information with them other than the command itself: TAKE_SCREENSHOT, REBOOT etc. but others might.
  • Program a script for your 'slave' computers that will look at a string (that will eventually contain a command) and perform the necessary action. For now, you should probably totally ignore network connectivity and expect the command to be entered via the same machine through an InputBox().
  • Will the script running on the 'master' computer require any form of feedback from the 'slave' computers for any of the commands?
Once you have those ideas worked out you can then worry about developing TCP sending and retrieval functions.

Edit: What I forgot to mention is that you probably shouldn't think about just sending AutoIt commands over the pipe because this will leave you with very limited options. That's why I suggest figuring out what you want to do on the 'slave' computers because then you can have that functionality sitting in their scripts ready to be executed when instructed by the 'master'.

Edited by LxP
Link to comment
Share on other sites

I don't know if this could help you, but I do this way to make a remote pc execute a function (thanks to someone in this forum (I don't remember who), to shutdown a remote pc):

I send, through autoit, a net command that pops up a window:

RunWait(@ComSpec & " /c " & 'net send -your pc remote name- "-your message window-"', "", @SW_HIDE)

Then the Pc has a listen program that runs to check if a window exists, then it executes a function. You can have different messages to trigger different tasks.

Link to comment
Share on other sites

I'm doing the same thing, but i control my clients via ini-files (well, it's just 2 ini-files)

1: containing clients, their request and the masters reply

2: containing actions to do, e.g. start another script or something like that

ok it's not as nice as tcp but it does the job

you can of course put both ini-files together, but that is a bit of a mess, if your adding more and more commands to your inifile

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...