Sign in to follow this  
Followers 0
GrahamT

Remote functions - possible?

5 posts in this topic

I've been looking for a program for the computer labs at my school, to do one specific thing - blackout the screen on the students' computers, at the click of a button on the teachers computer. Another click of the button to bring the screens back on.

Software is available, but is very expensive. Would such a thing be possible using AutoIt?

Thanks,

Graham

New International School of Thailand

Share this post


Link to post
Share on other sites



Yes it would be possible, but would take a bit of effort.

The remote portion of the script would be accessible via TCP functions. You would need a script on each of the computers to be running silently in the background at all times (this is easy). The script wouldn't have to do much, so it could be made as simple as possible - just wait for a connection, and then wait for the monitor off command. The teacher's script would be a tad tougher to make - it would have to connect to all servers (the ones on the students' computers), and then send a message to all of them.

The locking of the keyboard is even easier - simply do BlockInput(1).

You might also want to look at PsTools if the TCP stuff isn't for you. I have a feeling they can do what you're looking for too.

More info for TCP can be found here: http://www.autoitscript.com/forum/index.ph...topic=20589&hl=

Share this post


Link to post
Share on other sites

Thanks for the ideas - whether or not I get around to it in AutoIT depends on how much time I get to do this. Anyway, some other avenues to explore as well.

G

Share this post


Link to post
Share on other sites

Been working on it for the last three days, and finally got a workable program!

Thanks for the link to Office Poltergeist - the code in that taught me a lot!!

Blockinput(1), interestingly, doesn't seem to totally block the keyboard. After putting the computer in Monitor "Off" mode, a key press will bring back the screen, but the keyboard is then locked.

I basically used "For -> Next" loops and an array to create the TCP connections to all the workstations:

Func SetupConnections()
    For $station = 1 to $numStation
        $IPAddress = "192.168.15." & $station
        $connectedSocket[$station] = TCPConnect($IPAddress, $portAddress)
        If @error Or $connectedSocket[$station] < 1 THEN
            MsgBox(64, "TCP/IP Problem", "Could not connect to IP: " & $ipAddress & " and PORT: " & $portAddress, 1)
        EndIf
    Next
;MsgBox(64,"Ready", "TCP/IP Connections Ready", 5)
EndFunc

and then another loop to send the commands:

Func SendToAll($wsMsg)
    For $station = 1 to $numStation
        TCPSend($connectedSocket[$station],$wsMsg) 
    Next
EndFunc

Thanks for all your help.

Graham

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