Page 1 of 1

Automatically Organize Files according to their file types!!

Posted: 03 Apr 2010 06:09
by jamesfui
hi dostips expert batch scripters, :D

my pc FILES are all in a mess, cz long time no move them to proper folder!
how do you write a amazing bat script to organize/move all files type to its folder according to its own file extension??

for example,
c:\mess\*.pdf *.doc *.jpg *.mp3 *.mp4 *.bat *.etc

becomes like below,
c:\document\pdf\*.pdf
c:\document\word\*.doc
c:\pictures\jpg\*.jpg
c:\music\mp3\*.mp3
c:\etc\etc\*.etc

AND one Important thing is Never Rewrite the same filename, if exist same filename1, it will automatically save in filename2...

thanks in advance !! :D

Re: Automatically Organize Files according to their file typ

Posted: 05 Apr 2010 09:57
by avery_larry
I would do it manually from the command prompt:

cd /d c:\mess
move *.pdf "c:\document\pdf"
move *.doc "c:\document\doc"

It would take you just about as long to write the script file as it would be to just do it. Don't forget to make the directory first if needed:

md "c:\document\pdf"
. . .