
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2008 01:15 AM
send.au3
#include <GUIConstants.au3>
Opt("TrayIconHide", 1)
TCPStartup()
Dim $szServerPC = $cmdline[1]
Dim $szIPADDRESS = TCPNameToIP($szServerPC)
Dim $nPORT = 5555
Dim $ConnectedSocket = -1
While $ConnectedSocket = -1
$ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT)
WEnd
Dim $szData
If @error Then
MsgBox(4112, "Error", "TCPConnect failed with WSA error: " & @error)
Else
While 1
$szData = InputBox("My NetSender!", @LF & @LF & "Enter text to send to " & $cmdline[1] & "(" & $szIPADDRESS & "):")
$szData = $szData
If @error Or $szData = "" Then ExitLoop
TCPSend($ConnectedSocket, $szData)
If @error Then ExitLoop
WEnd
EndIf
receive.au3
#include <GUIConstants.au3>
#include <Constants.au3>
Opt("TrayIconHide", 1)
Dim $szIPADDRESS = @IPAddress1
Dim $nPORT = 5555
TCPStartUp()
$MainSocket = TCPListen($szIPADDRESS, $nPORT)
If $MainSocket = -1 Then Exit
Dim $ConnectedSocket = -1
Do
$ConnectedSocket = TCPAccept($MainSocket)
Until $ConnectedSocket <> -1
Dim $szIP_Accepted = SocketToIP($ConnectedSocket)
Dim $msg, $recv
While 1
$msg = GUIGetMsg()
$recv = TCPRecv( $ConnectedSocket, 2048 )
If @error Then ExitLoop
if $recv <> "" Then MsgBox(262208,"Message",$recv)
WEnd
If $ConnectedSocket <> -1 Then TCPCloseSocket( $ConnectedSocket )
TCPShutDown()
Func SocketToIP($SHOCKET)
Local $sockaddr = DLLStructCreate("short;ushort;uint;char[8]")
Local $aRet = DLLCall("Ws2_32.dll","int","getpeername","int",$SHOCKET, _
"ptr",DLLStructGetPtr($sockaddr),"int_ptr",DLLStructGetSize($sockaddr))
If Not @error And $aRet[0] = 0 Then
$aRet = DLLCall("Ws2_32.dll","str","inet_ntoa","int",DLLStructGetData($sockaddr,3))
If Not @error Then $aRet = $aRet[0]
Else
$aRet = 0
EndIf
$sockaddr = 0
Return $aRet
EndFunc
compile both scripts, you'll need psexec.exe as well, and use the following custom action commands on Lansweeper console:
cmd.exe /K \\server\share$\Lansweeper\psexec.exe \\{computer} -c -s -i \\server\share$\Lansweeper\receive.exe | \\server\share$\Lansweeper\send.exe {computer}
Well not much science on this one, but it works as expected so far, and doesn't depend on the annoying messenger service.
- Labels:
-
Custom Actions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2016 06:14 AM
In send.au3, when I compiled it and ran, this is the error "Line2270 (File
Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded."
thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2009 07:24 AM
As I see it, before a user will be remote controlled, we could first "talk" if the user has time to be remote controlled.
As it is now, you can send a note, but you do not really get a response back.
Thanks for the assist.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2009 02:15 PM
It's not that hard to implement the reply part, but I don't really need it...
Regards,
Paulo

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2009 02:10 PM
I figured it out. It was the line: "=============================="
in the receive.au3 that caused the issue.
Howver the complition did not complain on that.
It works now as expected.
My only comment is that it would be nice that the end-user should be able to reply back.
For the rest: Nice job !
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2009 11:39 AM
receive.exe | send.exe hostname
you can test this in your own computer, just use your computername as hostname, it should work, then you make the custom action with {computer} as parameter.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2009 10:01 AM
Good job
I am interested in this custom action.
I have downloaded and installed AutoIT.
I complied the sources to .exe files.
However, it does not work.
I tried manually to run receive.exe and it comes with error message:
Line -1: Error: Unable to parse line.
I have no experience with autoit, but the compilation went successfully.
When I try the custom action, I can see that receive is being copied.
and the dos screen stays open.
Nothing happens now.
On the remote computer the "receive.exe" process is running in the tasklist, but there is no window that the user can type anything.
Any ideas what can be wrong ?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2009 05:11 PM
send.exe expects a parameter, if you don't use the right syntax you'll get that error. Make sure you use the action as mentioned on the first post.
dayron:
For all domain you'll have to use net send, and have the needed service running. I've made this to send to a particular computer as a simple way to contact the logged in user.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2009 03:49 PM
Line-1:
Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded.
How can i fix this?
Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2009 05:46 PM
