Page 1 of 1

using system() cmds on different servers.

Posted: Mon Jul 19, 2010 12:16 pm
by khangol
I want to know if it is possible to use system() to run shell commands on another server on the network. IE i want to execute DIR on \\serverA\files and also on \\serverB\files. So far when i try

$last_line = system('dir \\serverA\files', $retval);

it does not return any results.

Is there a workaround for this? If I can't get this to to work I may try Perl.

ANY help much appreciated, thank you!

*** if you are interested in why I am doing this read below.

I post links of ISO files located on various servers on my company network and these links are posted online for my co-workers to use. However, these links only work in IE and not FF or Chrome. My workaround for this will be to move the files to a temporary folder on the hosting server when the link is clicked, and the file can then be downloaded from there.

Re: using system() cmds on different servers.

Posted: Mon Jul 19, 2010 8:43 pm
by Gargoyle
one of the great things about linux is that everything can be mapped to a directory. simply map the folder on the network machine to a folder on the local machine.

Re: using system() cmds on different servers.

Posted: Tue Jul 20, 2010 12:05 pm
by khangol
Gargoyle wrote:one of the great things about linux is that everything can be mapped to a directory. simply map the folder on the network machine to a folder on the local machine.
All of the machines are windows, is there a workaround for this?

Re: using system() cmds on different servers.

Posted: Tue Jul 20, 2010 9:57 pm
by Gargoyle
there are very, very few professional (L)AMP developers who work with windows, so you're pretty much on your own there, sorry.