Я пытаюсь создать пакетный сценарий, который скопирует все файлы usr из подпапок внутри каталога в 2 отдельные папки, а затем удалит файлы из их исходных мест. Пока что я сделал:
for /R S:\Customer Services\EDI\NET EDI %%f in (*.usr) do copy T:\edidata\netedi\Outboxtest
for /R S:\Customer Services\EDI\NET EDI %%f in (*.usr) do copy T:\edidata\netedi\Outbox backup
Это, однако, не копирование файлов, и ничего не происходит, где я здесь ошибся? И что мне нужно добавить, чтобы удалить файлы из исходных папок?
Изменить:
Судя по тому, как я читал ответы, я думал, что он должен стать:
for /R "S:\Customer Services\EDI\NET EDI" %%f in (*.usr) do copy %%F "T:\edidata\netedi\Outboxtest"
for /R "S:\Customer Services\EDI\NET EDI" %%f in (*.usr) do copy %%F "T:\edidata\netedi\Outbox backup"
, но это все еще не работает. Полагаю, я просто не понял, о чем говорилось.
Edit 2:
Я добавил команду PAUSE в конце скрипта, чтобы посмотреть, что происходило при его запуске и вот что получается:
S:\Customer Services\EDI\NET EDI>for /R "S:\Customer Services\EDI\NET EDI" %f in (*.usr) do copy %F "T:\edidata\netedi\Outboxtest"
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>for /R "S:\Customer Services\EDI\NET EDI" %f in (*.usr) do copy %F "T:\edidata\netedi\Outbox backup"
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy %F "T:\edidata\netedi\Outbox backup"
The system cannot find the file specified.
Надеюсь, последнее изменение.
Теперь у меня есть
for /R "S:\Customer Services\EDI\NET EDI" %%G in (*.usr) do copy %%G "T:\edidata\NetEDI\Outboxtest"
for /R "S:\Customer Services\EDI\NET EDI" %%G in (*.usr) do copy %%G "T:\edidata\NetEdi\Outbox backup"
PAUSE
, но он все еще не работает, вывод дано следующее:
S:\Customer Services\EDI\NET EDI>for /R "S:\Customer Services\EDI\NET EDI" %G in (*.usr) do copy %G "T:\edidata\NetEDI\Outboxtest"
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\gentest.usr "T:\edidata\NetEDI\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\Asda\asdatest.usr "T:\edidata\NetEDI\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\Costcutter\CCINV24052020.usr "T:\edidata\NetEDI\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\Costcutter\cctest.usr "T:\edidata\NetEDI\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\McColls Local Account\mccollstest.usr "T:\edidata\NetEDI\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\Scotmid\scotmidtest.usr "T:\edidata\NetEDI\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\Tesco\tescotest.usr "T:\edidata\NetEDI\Outboxtest"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>for /R "S:\Customer Services\EDI\NET EDI" %G in (*.usr) do copy %G "T:\edidata\NetEdi\Outbox backup"
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\gentest.usr "T:\edidata\NetEdi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\Asda\asdatest.usr "T:\edidata\NetEdi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\Costcutter\CCINV24052020.usr "T:\edidata\NetEdi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\Costcutter\cctest.usr "T:\edidata\NetEdi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\McColls Local Account\mccollstest.usr "T:\edidata\NetEdi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\Scotmid\scotmidtest.usr "T:\edidata\NetEdi\Outbox backup"
The system cannot find the file specified.
S:\Customer Services\EDI\NET EDI>copy S:\Customer Services\EDI\NET EDI\Tesco\tescotest.usr "T:\edidata\NetEdi\Outbox backup"
The system cannot find the file specified.
Итак, я собираю, что теперь он получает файлы, но не может найти папки для их копирования? Место назначения файла правильное для них обоих, я перепроверил, поэтому не уверен, что еще может быть не так.