A modern PowerShell GUI application that automatically customizes folder icons based on executables or custom icon files. Built with WPF for a clean, responsive interface.
Intelligently processes all subfolders with a priority-based system:
- Priority 1: Uses
icon.icoif present in the folder - Priority 2: Extracts icon from single
.exefile when noicon.icoexists - Smart Skip: Folders with multiple executables are sent to Manual Mode for user selection
Handles edge cases where automatic processing isn't possible:
- Visual display of all executable files with their icons
- Click to preview and select which icon to use
- Auto-syncs with Automatic Mode results
Switch between visual themes on the fly:
- Light Theme: Clean, bright interface with blue accents
- Ocean Theme: Calm, teal-inspired color palette
Full interface translation:
- English (EN) - Default
- French (FR)
Track your progress with live counters:
- Total folders analyzed
- Successfully processed folders
- Folders requiring manual selection
- Errors encountered
- Operating System: Windows 10 or later
- PowerShell: Version 5.1 or higher
- .NET Framework: 4.5 or later (usually pre-installed on Windows)
-
Download the repository:
git clone https://github.com/L-at-nnes/SetFolderIcons.git cd SetFolderIcons
-
Run the application:
.\SetFolderIcons-GUI-v3.ps1
Or bypass execution policy if needed:
powershell -ExecutionPolicy Bypass -File "SetFolderIcons-GUI-v3.ps1"
- Select your working folder (defaults to script directory)
- Click "Start automatic processing"
- The app scans direct subfolders (not recursive)
- Icons are applied based on priority rules
- Results appear in the statistics panel
- Switch to the Manual Mode tab
- Click "Analyze folders" to find problematic folders
- Select a folder from the list
- Choose an executable from the visual picker
- Click "Apply selected icon"
- Folder is automatically removed from the list
The application is split into four modules:
- SetFolderIcons-GUI-v3.ps1: Main entry point, UI definition (XAML), event handlers
- Themes.ps1: Theme color definitions and application logic
- Translations.ps1: Multi-language string dictionaries
- Core-Functions.ps1: Icon extraction, desktop.ini creation, folder analysis
The app creates a desktop.ini file in each folder with relative paths to make folders portable:
[.ShellClassInfo]
IconResource=.\icon.exe,0
IconFile=.\icon.exe
IconIndex=0This allows you to move folders to different locations while preserving custom icons.
Then sets Windows attributes:
desktop.ini→ System + Hidden- Parent folder → Read-only
Uses Windows API calls via C# interop:
shell32.dll→ ExtractIconuser32.dll→ DestroyIcon
Icons are extracted at runtime and displayed as 32x32 pixel previews in the manual mode.
| Situation | Action |
|---|---|
icon.ico exists |
✅ Use icon.ico |
Single .exe (no icon.ico) |
✅ Extract icon from exe |
Multiple .exe (no icon.ico) |
|
No .exe or icon.ico |
❌ Skip folder |
Solution: Wait a little, press F5 in File Explorer or restart Explorer:
Stop-Process -Name explorer -ForceSolution: Enable script execution (run as Administrator):
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSignedSolution: Ensure all module files are in the same directory as the main script:
- Themes.ps1
- Translations.ps1
- Core-Functions.ps1
Edit Themes.ps1 and add a new entry to the $script:Themes hashtable:
MyTheme = @{
Name = "MyTheme"
WindowBg = "#XXXXXX"
HeaderBg = "#XXXXXX"
# ... other color definitions
}Then add a button in the XAML section of the main file.
Edit Translations.ps1 and add a new language code:
ES = @{
AppTitle = "Establecer Iconos de Carpetas"
# ... other translations
}Add corresponding flag image to assets/ folder.
Contributions are welcome! Feel free to:
- Report bugs via GitHub Issues
- Suggest new features
- Submit pull requests
This project is open source and available under the MIT License.
Created by L-at-nnes