Page 1 of 1

exec a copy command over network

Posted: Thu Mar 09, 2006 8:11 am
by dubbelpunt
I have a file on my local C:\-drive. I would like to copy this file to another drive on the network. This drive is situated in a Unix-system. In my windows-system the drive is named as I:\.

I've tried the following exec-commando's, but none of them work.

Code: Select all

exec('copy C:\Inetpub\wwwroot\tbs\orders\sxw\eentest.sxw I:\spooloo\eentest.sxw');
and

Code: Select all

exec('copy C:\Inetpub\wwwroot\tbs\orders\sxw\eentest.sxw \\192.1.6.226\info\spooloo\eentest.sxw');
The directory spooloo has writable access on both the linux and windows system.

Posted: Thu Mar 09, 2006 8:43 am
by feyd
try

Code: Select all

$result = system('copy C:\\Inetpub\\wwwroot\\tbs\\orders\\sxw\\eentest.sxw \\\\192.1.6.226\\info\\spooloo\\eentest.sxw', $return);
if($result === false)
{
  echo 'copy call failed: ' . $return;
}
else
{
  echo 'copy returned: ' . $result;
}
Although php has a copy function. Have you tried it? copy()

Posted: Thu Mar 09, 2006 9:14 am
by dubbelpunt
this doesn't work either.

Copying in general is not the problem. I've copied several times from one directory to another on my local drive. He just won't copy on my networkdrive (this drive is on the server).

I want to know how I call a network drive in the exec() command.

Posted: Tue Mar 28, 2006 6:06 am
by gunhippy
Have you thought about mapping the network drive to a drive letter / mont before running the command so essentially php will think it's copying from drive to drive as opposed to from drive to UNC??