Skip to content

A script that organizes files based on their extensions

License

Notifications You must be signed in to change notification settings

wilsonsouto/file-organizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 

File Organizer

Github top language Github language count Repository size License

About   |   Features   |   Technologies   |   Requirements   |   Starting   |   License   |   Author


🎯 About

A script that organizes files based on their extensions. It scans a specified source directory for files and moves them to destination folders according to their file types. The script categorizes files into groups such as documents, images, and videos, and then moves them to their respective folders. Additionally, it provides error handling to manage any issues that may arise during the organization process.

✨ Features

✔️ Reading files: The code reads files from specified source directory;
✔️ Filtering by Extension: For each extension in the extensions object, it filters files in the source directory based on the extension;
✔️ Moving Files: It moves files to different destination folders (documents, pictures, videos) based on their extension;
✔️ Error handling: The try...catch block capture errors that may occur during the file moving process, providing a more robust error handling mechanism;

🚀 Technologies

The following tools were used in this project:

  • C#

✅ Requirements

Before starting 🏁, you need to have Git and .NET SDK installed.

🏁 Starting

# Clone this project
$ git clone https://github.com/wlsonsouto/file-organizer

# Access
$ cd file-organizer/FileOrganizer

# Open Program.cs and update the paths below to match your local directories:
# - source: The folder where your files are located (e.g., Downloads)
# - documents: The folder where you want to move document files (e.g., Documents)
# - pictures: The folder where you want to move image files (e.g., Pictures)
# - videos: The folder where you want to move video files (e.g., Videos)

string source = @"C:\YOUR-PATH\Downloads";
string documents = @"C:\YOUR-PATH\Documents";
string pictures = @"C:\YOUR-PATH\Pictures";
string videos = @"C:\YOUR-PATH\Videos";

# Once you've updated the paths, run the project
$ dotnet run

📝 License

This project is under license from MIT. For more details, see the LICENSE file.

Made with ❤️ by wilsonsouto

 

Back to top

About

A script that organizes files based on their extensions

Resources

License

Stars

Watchers

Forks

Languages