简体   繁体   English

批处理文件.txt移到另一个文件夹

[英]batch file move .txt to another folder

i want ot create a batch files but i have not much experience in this.. is anyone can help me? 我想创建一个批处理文件,但我对此没有太多经验。有人可以帮助我吗? i want to create a batch file which is the main function is to move some .txt files from a folder (A) to another folder (B)? 我想创建一个批处理文件,其主要功能是将某些.txt文件从一个文件夹(A)移至另一个文件夹(B)?
but those .txt that going move to other file must base by a condition and the condition is when i trigger the batch file i need to know the trigger time or current time and compare the created date and time of .txt file and it must 3 minutes and 3 second ago.. 但是那些要移到其他文件的.txt必须根据条件确定,该条件是我触发批处理文件时,我需要知道触发时间或当前时间,并比较.txt文件的创建日期和时间,并且它必须3分钟和3秒前
base by this condition i only do the cut and paste from folder A to B 根据这种情况,我只能将文件夹A剪切并粘贴到B
is it doable or anyone can provide me a link so i can refer to it.. 是可行的还是任何人都可以给我链接,所以我可以参考它。
thank you very much. 非常感谢你。

Yes this is do able. 是的,这是可行的。 You need to look at robocopy and it's switches, this should see you right. 您需要查看robocopy及其开关,这应该可以正确显示。 Just type robocopy /? 只需键入robocopy /? in cmd and make a note of all the switches you need as there are a lot! 在cmd中记下您需要的所有开关,因为有很多! There will be other ways of doing this with the if statement but I'm not entirely sure about the timestamp issue. 还有其他一些使用if语句执行此操作的方法,但是我不确定时间戳问题。 Maybe something like this: 也许是这样的:

if %Afiletimestamp% < %Bfiletimestamp% xcopy %Afilepath% %Bfilepath% /y 如果%Afiletimestamp%<%Bfiletimestamp%xcopy%Afilepath%%Bfilepath%/ y

I'm not sure how to aquire the first 2 variables though, maybe someone else can add to this? 我不确定如何获取前两个变量,也许其他人可以添加呢?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在文件夹中的txt文件列表中搜索“关键字”,如果找到“关键字”,则将txt文件移动到另一个文件夹(批处理脚本) - Search “keyword” in a list of txt file in a folder and move txt file to another folder if “keyword” is found (batch scripting) 批处理文件将文件夹移动到另一个 - Batch file to move a folder into another 批处理文件,用于在特定时间间隔内将.txt文件从一个文件夹移动到另一个文件夹,从而检查大小 - Batch file to move .txt files from one folder to another in a specific time interval keeping a check on the size 使用批处理文件将不同文件夹中的.txt文件移动到单个文件夹 - Move .txt files in different folders to a single folder using Batch file 批处理文件可将一个文件夹中的文件和文件夹移动到另一个文件夹 - Batch file to move files and folders in a folder to another folder 批处理文件将超过1年的文件移动到另一个文件夹 - Batch file to move file older than 1 year to another folder 创建批处理文件以在特定文件夹中搜索特定字符串的 .txt 文件,并将所有文件移动到新文件夹 - Creating Batch File to search .txt files in a specific folder for a specific string, and move all files to a new folder Windows批处理文件,用于将文件从特定的子文件夹移动到另一个文件夹 - Windows batch file to move files from specific subfolders to another folder 如何将特定文件从一个文件夹移动到txt文件指定的另一个文件夹? - How to move specific files from a folder to another folder specified by a txt file? 批处理文件Filename创建文件夹和txt文件 - Batch file Filename creates folder and txt file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM