开发者

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)?

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..

base by this condition i only do the cut and paste from folder A to B

is it doable or anyone can provide me a link so i can refer to it..

thank y开发者_JS百科ou very much.


Yes this is do able. You need to look at robocopy and it's switches, this should see you right. Just type robocopy /? in cmd and make a note of all the switches you need as there are a lot! There will be other ways of doing this with the if statement but I'm not entirely sure about the timestamp issue. Maybe something like this:

if %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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜