copy files and folders by date modified

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
karzer
Posts: 21
Joined: 17 Jul 2010 02:56

copy files and folders by date modified

#1 Post by karzer » 17 Jul 2010 03:22

Hi,

I have the existing thousands file folder according to their modified dates should be how we can make flour, I tried to do with xcopy and robocopy but could not be set to change the date, I wonder how we can do ?

Code: Select all

"robocopy" "xcopy" "xxcopy" ?



Image
Image
Image

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: copy files and folders by date modified

#2 Post by aGerman » 17 Jul 2010 05:23

Hmm, it's not that easy for me to understand. What means "how we can make flour"?

OK, tell me if I'm right:
You want to move your images depending on their "date last modified". The format of the new folder names is DDMMYYYY. The default date format of your system settings is DD.MM.YYYY.

Try this:

Code: Select all

@echo off &setlocal
pushd "D:\resim foto\Üni Etkinlikleri"
for %%a in (*.jpg) do (
  for /f "tokens=1-3 delims=. " %%b in ("%%~ta") do (
    md %%b%%c%%d 2>nul
    move "%%a" "%%b%%c%%d\%%a"
  )
)
popd
pause


Maybe I misspelled the folder name. You should check it.

Regards
aGerman

karzer
Posts: 21
Joined: 17 Jul 2010 02:56

Re: copy files and folders by date modified

#3 Post by karzer » 17 Jul 2010 16:24

Thank you very much ...


We solved the problem

Post Reply