문제

Here s the .bat I'm using curently:

for %%I in  (I:\ETOS\00-5-1-WA-1
I:\ETOS\00-5-3-WA-1
I:\ETOS\00-5-15-WA-1
I:\ETOS\00-5-18-WA-1
I:\ETOS\00-20-1-WA-1
I:\ETOS\00-20-2-WA-1
I:\ETOS\00-20-14-WA-1
I:\ETOS\00-25-06-2-2-WA-1
) do copy %%I C:\users\admin\desktop\age\to

Right now it just copies the contents of each folder without discrimination. I would like it to copy the entire folder (not just folder contents) and only copy those that have been modified within the last seven days.

Possible?

도움이 되었습니까?

해결책

Test this:

@echo off
for %%a in (
"I:\ETOS\00-5-1-WA-1"
"I:\ETOS\00-5-3-WA-1"
"I:\ETOS\00-5-15-WA-1"
"I:\ETOS\00-5-18-WA-1"
"I:\ETOS\00-20-1-WA-1"
"I:\ETOS\00-20-2-WA-1"
"I:\ETOS\00-20-14-WA-1"
"I:\ETOS\00-25-06-2-2-WA-1"
) do robocopy "%%~a" "C:\users\admin\desktop\age\to\%%~a" /e /maxage:7

다른 팁

This would work on Powershell V3. For example...

Copy-Item -Path C:\Intel -Recurse -Destination C:\Drivers|Where lastwritetime -GT "04/12/2014 12:00:00 AM"

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top