xcopy does not find the destination files

Asked

Viewed 223 times

0

I am developing a batch program that allows capturing xml files stored locally on other computers within my network, to capture these files I am using the xcopy command, however it does not locate the folder containing the files to be copied.

in the source parameter, after the variable %mes% there is a folder for each day ex.: 01, 02, 03, and each folder of these contains several xml files. I tried to put "... %mes %* *. *" (to get all folders, and then all files), but I was unsuccessful.

xcopy /I /Y /E /C /Q /G /H /J /S " pdv-01 Fiscal Archives Fiscal Archives Electronic Documents CF-e-SAT %ano% %mes%\*.\.*" "C: Desktop Office Users RRCSAT"

The error that persists is: File not found - . 0 Copied files. Or if I just switch to ...%mes%* (only, to supposedly get everything) Error: File not found - * 0 Copied files.

2 answers

0

Try replacing:

mes%\*.\.* for mes%\*.*


xcopy /I /Y /E /C /Q /G /H /J /S "\\pdv-01\Arquivos Fiscais\Arquivos Fiscais\Documentos Eletrônicos\CF-e-SAT\%ano%\%mes%\*.*" "C:\Users\Escritorio\Desktop\RRCSAT"

Or, considering the remark of @Ricardobohner

You could also map to a drive, turning the path of that folder into a drive/drive:

Map your network folder to drive/drive:

  • "\\pdv-01 Tax Archives Tax Archives Electronic Documents CF-e-SAT\"


net use Z: "\\pdv-01\Arquivos Fiscais\Arquivos Fiscais\Documentos Eletrônicos\CF-e-SAT\" sua_SENHA /user:seu_DOMÍNIO\SEU_NOME_de_USUÁRIO /persistent:yes

rem :: depois do comando, apenas aponte para a pasta dessa unidade/drive atribuída em z:\%anos%\%mes%\*.*" :: 

xcopy /I /Y /E /C /Q /G /H /J /S "z:\%anos%\%mes%\*.*" "C:\Users\Escritorio\Desktop\RRCSAT\"

-1

Good morning,

Did you check the folder permissions question? I have had problems, where my user did not have read permission inside the folder of the other computer...

  • So... I do this routine manually, I am automating what is done today Ctrl+C Ctrl+V. I have the folder permissions, I believe it is the way the source directory is informed. I want to copy the month folder with all subfolders and their respective xml, and this ...\\.* is the problem factor I believe.

  • I don’t think I need that part of ".." At the end of the /e and /s option, all subfolders are copied. xcopy /I /Y /E /C /Q /G /H /J /S " pdv-01 Fiscal Archives Tax Archives Electronic Documents CF-e-SAT%ano%mes%mes%" "C: Desktop Office Users RRCSAT"

  • "File not found - 0 Copied"

  • This location " pdv-01 Tax Files" and a network computer? If so, why is it not in format: Sharename Computer..

Browser other questions tagged

You are not signed in. Login or sign up in order to post.