简体   繁体   English

批处理文件使用多个文本文件将文件移动到另一个目录

[英]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.

相关问题 批处理文件以重命名多个文件并移至文件夹 - Batch File to rename multiple files and move to folder 使用FOR循环将文件移动到另一个目录 - Using FOR loop to move files into another directory 搜索文本文件中列出的多个文件并复制到另一个目录 - Search multiple files listed in a text file and copy to another directory 将文本文件中命名的文件批量移动到文本文件提供的目录中 - Batch move files named in a text file to directories provided by text file 使用批处理文件从列表创建多个文本文件 - create multiple text files from a list using batch file 使用Windows批处理脚本将文本文件拆分为多个文件 - Split text file into multiple files using windows batch scripting 批处理文件以递归方式查找名为特定名称的文件并移至目录 - Batch file to recursively find files named a specific name and move to a directory Windows批处理文件:使用UnixUtils find命令将X分钟之前的文件移动到其他目录 - Windows batch file: move files older than X minutes to a different directory using UnixUtils find command 将目录文件复制到批处理文件中的另一个目录,而无需询问? - Copy Directory files to another directory in batch file without asking? 创建批处理文件以删除,重命名和移动多个文件的多个子文件夹 - Create batch file to delete,rename and move multiple files multiple subfolder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM