I am trying to run the xcopy command from the php via exec() function : the following are my codes
$execute = ('xcopy "\\\\192.1.1.52\\xcopy_folder\\testfile.txt" "c:\\xcopy_folder\\"',$output);
exec($execute,$output);
echo $output."<br />";
echo $execute;
it shows 0 file copied together with the command which was executed, I then copy and paste the command to cmd prompt, it does copy the file to my destination folder, can anyone please assist, thank you !
I have tried the following :
instead of using the computer name, I tried the IP address (does the same thing - php does not work but working with DOS prompt), still shows 0 file copied.
instead of using the computer name and ip address, I mapped a drive(G:) to the folder and use the drive symbol instead (it also not working with exec but works fine with DOS prompt)- same result as above.
the computer contains the source file is locate overseas (slow connection), and I've tried to copy the file that is in the same network (next to my computer), does not matter if I use the IP address or computer name it works like charm.
Please help :(