metinsaylan // rogue developer

Windows Batch to Clear Your Desktop

A simple windows batch file for cleaning files on your desktop

As a part of my simple living plan, I have written a windows dos batch script to clear all the files on the desktop. What it does is simple really; it creates a folder and moves all files in to that folder. But believe me, it helps a lot :) Here is the script:

mkdir %USERPROFILE%\Desktop\Apps
move %USERPROFILE%\Desktop\*.lnk %USERPROFILE%\Desktop\Apps
mkdir %USERPROFILE%\Desktop\Desktop
move %USERPROFILE%\Desktop\*.* %USERPROFILE%\Desktop\Desktop

I also changed the code a little bit to move files in date folders. But you may need to tune this one a little bit. Because date formats change between languages. Here is the alternative version:

mkdir %USERPROFILE%\Desktop\Apps
move %USERPROFILE%\Desktop\*.lnk %USERPROFILE%\Desktop\Apps
mkdir %USERPROFILE%\Desktop\Desktop
mkdir %USERPROFILE%\Desktop\Desktop\%date:/=%
move %USERPROFILE%\Desktop\*.* %USERPROFILE%\Desktop\Desktop\%date:/=%\

Enjoy!

Search Windows Batch to Clear Your Desktop on Google