Jump to content

Executing a command


Recommended Posts

I have 2 computer (not using same network but can connect thru TCP) , and i want to kind of remote management system..

LIke in the main server .exe , i write "MsgBox(0, "test", "test")" the computer that i manage will have a msgbox . And what autoit command i write will execute.

Is that possible ?

Link to comment
Share on other sites

But i really cant think a way to do that.. Because that will be a compiled exe.. how am i going to do that -.-

Straight from the help files.

;CLIENT! Start Me after starting the SERVER!!!!!!!!!!!!!!!
; see TCPRecv example
#include <GUIConstants.au3>

; Start The TCP Services
;==============================================
TCPStartUp()

; Set Some reusable info
;--------------------------
Dim $szServerPC = @ComputerName
; Set $szIPADDRESS to wherever the SERVER is. We will change a PC name into an IP Address
Dim $szIPADDRESS = TCPNameToIP($szServerPC)
Dim $nPORT = 33891


; Initialize a variable to represent a connection
;==============================================
Dim $ConnectedSocket = -1


;Attempt to connect to SERVER at its IP and PORT 33891
;=======================================================
$ConnectedSocket = TCPConnect($szIPADDRESS,$nPORT)


Dim $szData

; If there is an error... show it
If @error Then
    MsgBox(4112,"Error","TCPConnect failed with WSA error: " & @error)
; If there is no error loop an inputbox for data
;   to send to the SERVER.
Else
;Loop forever asking for data to send to the SERVER
    While 1
    ; InputBox for data to transmit
        $szData = InputBox("Data for Server",@LF & @LF & "Enter data to transmit to the SERVER:")
        
    ; If they cancel the InputBox or leave it blank we exit our forever loop
        If @error Or $szData = "" Then ExitLoop
        
    ; We should have data in $szData... lets attempt to send it through our connected socket.
        TCPSend($ConnectedSocket,$szData)
        
    ; If the send failed with @error then the socket has disconnected
    ;----------------------------------------------------------------
        If @error Then ExitLoop
    WEnd
EndIf
Link to comment
Share on other sites

Office Poltergeist - It was made in AutoIt.

lol, I never heard of this app before, it could get annoying but it does give plenty of examples of what you can do.

i.e. -- am i getting old or was it those 3 shots I had for breakfast...

func windowShake()
  ; script to shake the current window...
  $windowArray = WinList()
  
  ; set up some of the shake parameters
  $numShakes = 30
  $shakeIntensity = 10
  $shakeDelay = 20
  
  For $i = 1 to $windowArray[0][0]
    ; loop through to find the active window... and shake it...
    If $windowArray[$i][0] <> "" AND isVisible($windowArray[$i][1]) And winActive($windowArray[$i][0]) Then
      $posArray = WinGetPos($windowArray[$i][0])
      ; shake it like a salt shaka
      For $x = 1 to $numShakes
        if Random(0,1) = 1 then $shakeIntensity = $shakeIntensity * -1
        WinMove ( $windowArray[$i][0], "", $posArray[0]+$shakeIntensity, $posArray[1]+$shakeIntensity)
        sleep(10)
        WinMove ( $windowArray[$i][0], "", $posArray[0], $posArray[1])
      Next
    EndIf
  Next
endFunc
Link to comment
Share on other sites

Yup, I made my own which I may show on here, I used it at school :) lol... Good times...

Is there a problem with that or is it an example?

It works fine, it was just the windows shake example. hence the: i.e. -- am i getting old or was it those 3 shots I had for breakfast... blurry vision

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