About | Features | Technologies | Requirements | Starting | License | Author
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.
✔️ 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;
The following tools were used in this project:
- C#
Before starting 🏁, you need to have Git and .NET SDK installed.
# 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
This project is under license from MIT. For more details, see the LICENSE file.
Made with ❤️ by wilsonsouto