Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

How to run a process on an NT server from a client computer

by Anonymous Monk
on Sep 05, 2001 at 01:46 UTC ( [id://110172]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to make a perl script that will run an .exe on a networked machine from another machine. For instance I want to run a perl script on 10.10.10.1 and have it execute excel.exe on 10.10.10.2. The process will actually be running on 10.10.10.2 not on 10.10.10.1. Is there a way to do this?

Replies are listed 'Best First'.
Re: How to run a process on an NT server from a client computer
by $code or die (Deacon) on Sep 05, 2001 at 05:45 UTC
    Hi there

    There is a recent discussion here and a follow-up here that discuss a few methods of doing this. I am afraid that idnopheq's method will only work if your exe exposes methods via COM.

    I hope this helps. It really depends on whether it's a maintenance task that you want to run at set intervals or if you want to execute the remote program on demand.

    Error: Keyboard not attached. Press F1 to continue.
Re: How to run a process on an NT server from a client computer
by idnopheq (Chaplain) on Sep 05, 2001 at 02:14 UTC
    If you can provide more information, that would be most helpful. Yet ...

    Win32::OLE will do this, anticipating all the participating machines are Win32 and IIRC if excel is all ready running on the destination box. From perldoc:

    To create an object via DCOM on a remote server you can use an array reference in place of PROGID. The referenced array must contain the machine name and the program id or class id. For example: my $obj = Win32::OLE->new('my.machine.com', 'Program.Id');

    You can also use rcmd from the NT/2K Resource Kit. rcmd is a faux-telnet client-server bit. It is light-weight and highly insecure, but hey ...

    You could use VNC. You could write a client-server perl app. TIMTOWTDI. YMMV.

    HTH
    --
    idnopheq
    Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.

      Let's see if I can clarify: I want to do something similar to the system() command. However, the external program I want to run is on a remote computer on my network. The program that I want to run can only be run on that remote computer (i.e. nodelocked program). From my computer, how can I execute a remote *.exe file?
        There are many programs out there for remote execution. You can use a unix-like rsh, or a COM-based thing, or a few others. Find one you like, and use that from Perl. There's one or two in the Resource Kit. I think it was on sysinternals.com where I saw one that didn't need software installed on the remote system first. You could even write your own in a few lines of Perl using a socket or named pipe interface.
Re: How to run a process on an NT server from a client computer
by OzzyOsbourne (Chaplain) on Sep 05, 2001 at 20:43 UTC

    I don't know of any Perl solutions to get the process to run on the other box, but here are some Non-Perl solutions:

    • The AT scheduler allows for the remote scheduling of commands, and it's built-in. Type AT from the command line for info.
    • psexec.exe from www.sysinternals.com. It's freeware, and I use it without issue.
    • if you have a majillion dollars, SMS works

    -OzzyOsbourne

Re: How to run a process on an NT server from a client computer
by RayRay459 (Pilgrim) on Sep 05, 2001 at 20:47 UTC
    Anon Monk,
    I asked for help on this very same topic. I was told that there is not really a perlish was to do this, but there are other things out there to help you do what you want. RSH (Remote Shell Daemon) which opens up a command box on the remote machine. SSH and WMI. While where i work, we have RSH, the powers that be want to get me to not use that to execute programs remotely. RCMD seems like too big of a security risk. We don't have SSH yet or WMI..but may be in the future. If you do find a perlish way to do this, please let me know. i would greatly appreciate it.
    good luck. Ray

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://110172]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-03-28 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found