使用php.exe -f自动复制和创建服务器文件夹中的文件

I try to copy this file capturar_dades_preparar_mail.php in C:\xampp\htdocs\Projecte_a\engine_automail_win to C:\xampp\htdocs\Projecte_a\engine_automail_win\mails_preparats_per_enviar with other name.php.

Well, to do this I have this code that is executed automatically with task scheduler in Windows:

$nombre_archivo = "mail_preparat.php";
$ruta= "../../xampp/htdocs/projecte_a/engine_automail_win/mails_preparats_per_enviar/";

if(!copy("../../xampp/htdocs/projecte_a/engine_automail_win/estructura_mail_a_preparar.php" , $ruta.$nombre_archivo)) {
  echo "Error al copiar 
";

But that doesn't copy the file. The problem is that I don't know how to access a file in this folder when executing an automated job because with php you access a files with /, and cmd/ms-dos is with .

I tried with / and \ but doesn't work.

Sorry for my English.

May I ask why you use relative paths in your script when you know the absolute paths? I suggest you test with absolute paths to start with, just to remove the possibility that you have made an error working them out.

The relative path will be relative to where you execute the script from, not where the script is.