The Desktop Cleaner Script is a utility for organizing files in a directory into specific folders based on their file extensions. This helps in maintaining a neat and organized directory, whether it's your desktop or any specific folder that needs cleaning. The script is available in three versions: Python, Bash, and Windows CMD file.
- Support for Multiple File Types: Organizes a wide range of file types including documents, images, videos, spreadsheets, presentations, audio files, and more.
- Automatic Folder Creation: Automatically creates folders if they don't already exist.
- Platform-Specific Scripts: Available for Windows (CMD), Linux, and macOS (Bash), and universally (Python).
Before running the scripts, ensure you have the necessary environment set up:
- Python: Python must be installed for the Python script. Download Python
- Bash: Default on Linux and macOS systems.
- Windows Command Prompt: For running CMD scripts on Windows.
To get started with these scripts, clone the repository to your local machine using:
git clone https://github.com/RohanHandore/Desktop-Cleaner-Script.git
cd desktop-cleaner
To run the CMD script from any directory:
- Right-click on 'This PC' or 'Computer' on your desktop or in File Explorer.
- Select 'Properties'.
- Click on 'Advanced system settings'.
- In the System Properties window, click on the 'Environment Variables' button.
- In the Environment Variables window, find the 'Path' variable in the 'System variables' section and click 'Edit'.
- In the Edit Environment Variable window, click 'New' and add the path to the folder where your
clean.cmd
script is located. - Click 'OK' on all dialogs to close them and apply the changes.
- Navigate to the script directory.
- Run the script using:
This will organize the current directory.
python clean.py
- Ensure the script is executable:
chmod +x clean.sh
- Run the script:
This executes the script in the current directory.
./clean.sh
- Run the script in CMD:
This will organize files in the current directory on Windows.
clean.cmd
The script categorizes and moves files based on the following extensions:
- Documents:
.txt
,.docx
,.pdf
,.doc
,.rtf
,.odt
- Images:
.jpg
,.jpeg
,.png
,.gif
,.bmp
,.tiff
,.ico
,.svg
,.psd
,.ai
- Videos:
.mp4
,.avi
,.mov
,.wmv
,.mkv
,.flv
,.m4v
,.webm
,.3gp
,.mpg
,.mpeg
,.ts
,.vob
- Spreadsheets:
.xls
,.xlsx
,.csv
- Executables:
.exe
,.cmd
,.sh
,.jar
- Contacts:
.vcf
- Presentations:
.ppt
,.pptx
,.key
,.odp
- Audio:
.mp3
,.wav
,.aac
,.ogg
,.flac
- Archives:
.zip
,.rar
,.7z
,.tar
,.gz
- Run the below command in the terminal if you have bend setup:
bend run cleaner.bend