CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Running a batch file on a remote PC

 



hem
User

Apr 6, 2009, 4:40 PM

Post #1 of 10 (1500 views)
Running a batch file on a remote PC Can't Post

Hi

I have to run a batch file on a remote PC.

Scenario

1. Run a perl script on machine A
2. from the perl script execute a batch file (which runs a exe in C)
3. batch file takes arguments

Not sure where to start looking.Is there a CPAN module that I can start with

Thanks lot


Tumata
User


Apr 8, 2009, 6:58 AM

Post #2 of 10 (1486 views)
Re: [hem] Running a batch file on a remote PC [In reply to] Can't Post

You need something on server (machine C) and client (machine A) sides both. For example you may consider such solution:

* Run SSH daemon on server side
* Use Net::SSH::Perl module on client side

In addition this solves some security issues (channel between A and C is encrypted) .


hem
User

Apr 8, 2009, 8:45 AM

Post #3 of 10 (1481 views)
Re: [Tumata] Running a batch file on a remote PC [In reply to] Can't Post

Hi

Might be a stupid question but will this work on Windows XP too
Thanks


Tumata
User


Apr 9, 2009, 1:31 AM

Post #4 of 10 (1474 views)
Re: [hem] Running a batch file on a remote PC [In reply to] Can't Post

Yes. It should work.


hem
User

Apr 16, 2009, 1:12 PM

Post #5 of 10 (1449 views)
Re: [Tumata] Running a batch file on a remote PC [In reply to] Can't Post

Hi

I looked into this but can you suggest what should be running on the server machine which has Windows XP.

Not sure what to install on the server

Thanks


Tumata
User


Apr 16, 2009, 1:51 PM

Post #6 of 10 (1446 views)
Re: [hem] Running a batch file on a remote PC [In reply to] Can't Post

Look at this
http://forums.cacti.net/about5816.html&highlight=


(This post was edited by Tumata on Apr 16, 2009, 1:52 PM)


hem
User

Apr 17, 2009, 8:05 AM

Post #7 of 10 (1427 views)
Re: [Tumata] Running a batch file on a remote PC [In reply to] Can't Post

Hi

Thanks but isn't this for DB connectivity. I am looking for running commands on remote machine

If i did not understand it correctly my apologies


FishMonger
Veteran / Moderator

Apr 17, 2009, 9:05 AM

Post #8 of 10 (1425 views)
Re: [hem] Running a batch file on a remote PC [In reply to] Can't Post

You need to install OpenSSH for Windows
http://sshwindows.sourceforge.net/


1arryb
User

Apr 17, 2009, 9:48 AM

Post #9 of 10 (1421 views)
Re: [hem] Running a batch file on a remote PC [In reply to] Can't Post

Hi hem,

I've been reading about GRID::Machine on CPAN http://search.cpan.org/~casiano/GRID-Machine-0.104/lib/GRID/Machine.pod.
It may be overkill for your use case, but then handling ssh exit codes and failure use cases is a pain as well.

Cheers,

Larry


Tumata
User


Apr 17, 2009, 1:33 PM

Post #10 of 10 (1413 views)
Re: [hem] Running a batch file on a remote PC [In reply to] Can't Post

I think that it is better to NOT install any additional soft. Instead you can use existing mechanism as WMI. All you need is to google a bit. I tried to gogle it and found this http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept04/hey0901.mspx Look:

Quote
Using WMI, you can connect to a remote machine (assuming you have local administrator rights, of course) and then run any piece of software thatís installed on that machine.

As I think it is what you need.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives