Skip to main content

How to automatically organize your desktop or a folder


  • Lets say you have a list of files in your desktop or your usb drive and you want to organize each to a different folder e.g all the mp3 files to its folder,all the text files to it folder and more 
      1.Copy the code below to and paste it to an empty notepad and save it with a .cmd extension e.g          example.cmd / config.cmd


    ---------------------CODE----------------
 echo off 

cls

set l=___________________________________
echo Config

set mp3=mp3
set txt=txt
set pdf=pdf
set jpg=jpg
set png=png
set files=files

echo %l%
echo Creating folder %mp3%
echo %l%
if  exist %mp3% (

echo The folder %mp3% was found,moving files... 
move *.mp3 %mp3% 

) else ( 
echo  The folder %mp3% does not exist,please wait...
md %mp3% 
echo %mp3% created,moving files...
move *.mp3 %mp3% 
 
)


echo %l%
echo Creating folder %txt%
echo %l%
if  exist %txt% (

echo The folder %txt% was found,moving files... 
move *.txt %txt% 

) else ( 
echo  The folder %txt% does not exist,please wait...
md %txt% 
echo %txt% created,moving files...
move *.txt %txt% 
 
)

echo %l%
echo Creating folder %pdf%
echo %l%
if  exist %pdf% (

echo The folder %pdf% was found,moving files... 
move *.pdf %pdf% 

) else ( 
echo  The folder %pdf% does not exist,please wait...
md %pdf% 
echo %pdf% created,moving files...
move *.pdf %pdf% 
 
)


echo %l%
echo Creating folder %jpg%
echo %l%
if  exist %jpg% (

echo The folder %jpg% was found,moving files... 
move *.jpg %jpg% 

) else ( 
echo  The folder %jpg% does not exist,please wait...
md %jpg% 
echo %jpg% created,moving files...
move *.jpg %jpg% 
 
)


echo %l%
echo Creating folder %png%
echo %l%
if  exist %png% (

echo The folder %png% was found,moving files... 
move *.png %png% 

) else ( 
echo  The folder %png% does not exist,please wait...
md %png% 
echo %png% created,moving files...
move *.png %png% 
 
)

echo %l%
echo Creating folder %files%
echo %l%
if  exist %files% (

echo The folder %files% was found,moving files... 
move /-y *.files %files% 

) else ( 
echo  The folder %files% does not exist,please wait...
md %files% 
echo %files% created,moving files...
move /-y *.files %files% 
 
)

echo %l%
echo Configuring...
echo %l%
:for /f %%i in ('dir /a:d') do echo %%i


pause
 


------------------ RESULTS -----------------------------



Comments