Automatically Organize Files according to their file types!!

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
jamesfui
Posts: 50
Joined: 27 Mar 2010 23:00

Automatically Organize Files according to their file types!!

#1 Post by jamesfui » 03 Apr 2010 06:09

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

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

Re: Automatically Organize Files according to their file typ

#2 Post by avery_larry » 05 Apr 2010 09:57

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

Post Reply