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

Popular posts from this blog

How to create 50 folders at once using cmd.exe

Lets say you want to create 50 folders at once without creating each and typing its name, you just want to create all of them in a go, this is how you would do it.      1.Start cmd.exe, if you are not sure how to, check one of the tutorials and it will show you how.      2.After you have started cmd, create a folder to contain all your folders type md group       3.No create your 50 folders inside this folder called 'group', type for /l %i in (1,1,50) do md group\%i    

Zavigne