?
Solved

How can i send message from Linux platform to Windows platform

Posted on 2003-03-04
9
Medium Priority
?
428 Views
Last Modified: 2012-05-05
Hi.

I want know how can i program a perl scripts to send some message from LINUX/UNIX to a pc which OS is Windows 2000?

just as the "net send <IP> <message>" command of Windows.

Thanks for any answers.

Y.C.
0
Comment
Question by:yc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 26

Accepted Solution

by:
wilcoxon earned 400 total points
ID: 8065419
You have several options that I can think of.

1) Find out more information about the way "net send <IP> <message>" works and code it in perl.  The information on how it works may not be available (Microsoft loves hiding protocol details).
2) Find a *nix command that somebody else wrote that interoperates with the Windows "net send".  A quick search of Google for "net send unix" didn't pull up anything obviously useful, but I didn't dig into it or refine the search.
3) I believe there is a way of sending messages from *nix to Windows using Samba, but I have never used Samba (one of many things on my list of things to try with my FreeBSD box at home).
4) If the Windows box is running Exceed or another X suite, you can pop up pretty much anything you want on the Windows box.
0
 
LVL 2

Assisted Solution

by:Itatsumaki
Itatsumaki earned 400 total points
ID: 8065933
Or write a client/server pair and set up servers on one/both boxes.  You'd need to use TCP/IP for that, I suspect.
0
 

Author Comment

by:yc
ID: 8069342
Dear wilcoxon and itatsumaki:

I am very happy for receiving your words.

Just as wilcoxon's said, I had sent the message by use "smbclient" command from LINUX/UNIX platform to Windows successfully.

But I need to realize the same work by my self perl program. I think, maybe i should use some special module such as "socket".

thanks wilcoxon & itatsumaki again.

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 26

Expert Comment

by:wilcoxon
ID: 8069568
If you want to write your own perl program to do something similar, you will need to use Socket (or something similar).  I have fairly minimal experience with using Socket or other low-level TCP/IP modules.
0
 
LVL 2

Expert Comment

by:Itatsumaki
ID: 8073547
I'm also no expert on TCP/IP stuff -- and if you can't use TCP/IP I can't help you at all.  But anyways, here goes.  This script works, but it's just playing around.  I've never done anything more serious than this with PERL sockets.  Now, if you wanted C++? :)

# CREATE SERVER
use IO::Socket;
my $socket = IO::Socket::INET->new(
                LocalPort => 1115,
                Type      => SOCK_STREAM,
                Reuse     => 1,
                Listen    => 5
                ) or die "I want my (server) socket!\n";
while ($client = $server->accept()) {
        $line = <$client>;
        if ($line = '333') { last(); }
        print $line;
        }

print $client "I'm outta here!\n";
close($server);

# CREATE CLIENT
use IO::Socket;
my $socket = IO::Socket::INET->new(
                PeerAddr => '192.168.2.133',
                PeerPort => 1115,
                Proto    => 'tcp',
                Type     => SOCK_STREAM
                ) or die "I want my (client) socket!\n";

print $socket "I'm the client!\n";
$answer = <$socket>;
print "$answer\n";
close($socket);
0
 

Expert Comment

by:isaxu
ID: 8077671
to Itatsumaki:
Your program can send message from client to server, that's good. But I thind what YC need is a program like smbclient,which can send popup message to windows2000/NT directly.Can you give some advice or other sample code?thanks!
0
 
LVL 2

Expert Comment

by:Itatsumaki
ID: 8078410
If you leave the server running all the time, then all you need to do is use a Tck window for the pop-up!

If you're worried about having a DOS window open all the time in Windows, there should be a way to make it run as a service.

I can give you code for the Tck pop-up tomorrow, but you're on your own for running it as a service -- I've never done that!
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9692777
Nothing has happened on this question in over 7 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
split points [grade B] between wilcoxon and Itatsumaki.

Please post any comments here within the next seven days. Moderators check comments here before acting on the recommendation. Experts: silence will likely be taken as assent.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question