[英]Batch File Move files using multiple text files into another directory
I am trying to create a batch file to loop through multiple text files and copy the files that are in text files. 我正在尝试创建一个批处理文件以遍历多个文本文件并复制文本文件中的文件。 I have set the query to copy for now.
我已将查询设置为现在复制。 When the query works I want to change it to move.
查询工作时,我想将其更改为移动。 Currently this file does nothing.
当前,此文件不执行任何操作。
@echo off
set Source=T:\_Epic\Data Conversion\ChartMaxx Docs\LOPE\More\
set Target=T:\_Epic\Data Conversion\MovedFiles\
echo.
if not exist "%Source%" echo Source folder "%Source%" not found & goto Exit
if not exist "%FileList%" echo File list "%FileList%" not found & goto Exit
if not exist "%Target%" md "%Target%"
for /f "delims=" %%a IN ('xcopy "T:\*" T:\ /l') do echo %%a
:Exit
echo.
echo press the Space Bar to close this window.
pause > nul
Two immediate problems jump out. 出现了两个直接的问题。
One - you haven't set a value into filelist
so likely it won't be found. 一个-您尚未在
filelist
设置值,因此很可能找不到该值。
Two - your xcopy
attempts to list the files that would be copied from T:\\*
to T:\\
- you probably wanted %source%*
to %target%
. 两次-您的
xcopy
尝试列出将从T:\\*
复制到T:\\
-您可能希望将%source%*
复制到%target%
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.