Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How can i send message from Linux platform to Windows platform

Posted on 2003-03-04
9
Medium Priority
?
433 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
8 Comments
 
LVL 27

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 27

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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
Suggested Courses

581 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