A collection of utilities for Windows system administration, troubleshooting, and file management. This toolkit includes scripts for batch font installation, automated zip file extraction, and Bluetooth audio diagnostics and repair.
This repository contains four main utilities:
- Font Installer (Python) - Automatically installs font files from multiple folders with admin elevation support
- Zip Extractor (Python) - Batch extracts zip files into organized subfolders
- Bluetooth Audio Diagnostics (PowerShell) - Comprehensive diagnostics for Bluetooth audio device issues
- Bluetooth Audio Fix (PowerShell) - Automated fixes for common Bluetooth audio problems
All tools include comprehensive error handling, detailed logging, and user-friendly progress reporting.
- Batch Installation: Install fonts from all subfolders automatically
- Multiple Installation Methods: Uses Windows Shell COM, direct file operations, registry, and Windows API
- Smart Detection: Checks if fonts are already installed
- Flexible Overwrite Options: Ask, skip, or force overwrite existing fonts
- Dry Run Mode: Preview what would be installed without actually installing
- Admin Privilege Detection: Warns if not running with administrator rights
- Supported Formats: .ttf, .otf, .ttc, .fon, .fnt
- Detailed Logging: Shows real-time progress and comprehensive summary
- Batch Processing: Process all zip files in a folder automatically
- Smart Folder Creation: Creates subfolders based on zip file names
- Validation: Checks zip file integrity before extraction
- Error Handling: Handles corrupted files and permission issues gracefully
- Progress Logging: Shows real-time progress and detailed summary
- Cross-Platform: Works on Windows, macOS, and Linux
- Comprehensive Device Scanning: Lists all audio devices with detailed status
- Driver Status Checks: Verifies Bluetooth audio driver and A2DP profile status
- Volume Level Detection: Identifies volume-related issues
- PnP Device Analysis: Checks for device problem codes and errors
- Service Status: Verifies Bluetooth and audio service health
- Device Switching Tests: Tests ability to switch between audio devices
- Registry Validation: Checks audio configuration in Windows registry
- A2DP Driver Reset: Disables and re-enables Bluetooth audio drivers
- Audio Endpoint Refresh: Resets audio endpoint configurations
- Service Restart: Restarts Bluetooth and audio services
- Default Device Configuration: Forces correct default device selection
- Automated Verification: Checks if fixes resolved the issues
- Guided Troubleshooting: Provides next steps if automated fixes don't work
- Python 3.6 or higher (for Python utilities)
- Windows operating system
- PowerShell 5.1 or higher (for Bluetooth scripts)
- Administrator privileges (required for Font Installer and Bluetooth scripts)
-
Clone or download this repository:
git clone <repository-url> cd WindowsUtils
-
Install dependencies:
pip install -r requirements.txt
For Bluetooth audio scripts, install the AudioDeviceCmdlets module:
Install-Module -Name AudioDeviceCmdlets
Note: The Zip Extractor uses only Python standard library and requires no additional packages.
-
Install fonts from current directory (with prompts):
python font_installer.py
-
Install fonts from specific folder:
python font_installer.py "C:\Downloads\Fonts"
-
Dry run (preview without installing):
python font_installer.py --dry-run
-
Force overwrite existing fonts:
python font_installer.py --force
-
Skip existing fonts automatically:
python font_installer.py --overwrite no
Option | Description | Example |
---|---|---|
folder_path |
Path to folder with font subfolders | python font_installer.py "C:\Fonts" |
--dry-run |
Preview fonts without installing | python font_installer.py --dry-run |
--overwrite {yes,no,ask} |
Handle existing fonts | python font_installer.py --overwrite yes |
--force |
Force overwrite (same as --overwrite yes ) |
python font_installer.py --force |
--verbose, -v |
Enable verbose logging | python font_installer.py -v |
--no-admin-check |
Skip administrator privilege check | python font_installer.py --no-admin-check |
Example 1: Install fonts with prompts for existing fonts
python font_installer.py "C:\Downloads\FontCollection"
Example 2: Preview what would be installed
python font_installer.py "C:\Downloads\FontCollection" --dry-run
Example 3: Install fonts, skipping existing ones
python font_installer.py "C:\Downloads\FontCollection" --overwrite no
Example 4: Force install all fonts, replacing existing
python font_installer.py "C:\Downloads\FontCollection" --force
Font Installer for Windows
========================================
Processing folder: C:\Users\YourName\Downloads\Fonts
----------------------------------------
2024-01-15 14:30:25 - INFO - Found 15 font file(s) in 3 folder(s) to install
2024-01-15 14:30:25 - INFO - Processing font: Roboto-Regular.ttf
2024-01-15 14:30:26 - INFO - Successfully installed: Roboto-Regular.ttf
2024-01-15 14:30:26 - INFO - Processing font: Roboto-Bold.ttf
2024-01-15 14:30:26 - INFO - Skipped: Roboto-Bold.ttf - Font already installed (skipped)
============================================================
FONT INSTALLATION SUMMARY
============================================================
Folders with fonts processed: 3
Total font files processed: 15
Successfully installed: 12
Failed installations: 0
Skipped (already installed): 3
Detailed Results:
----------------------------------------
Folder: C:\Users\YourName\Downloads\Fonts\Roboto
✓ Roboto-Regular.ttf
⏭️ Roboto-Bold.ttf - Font already installed (skipped)
✓ Roboto-Italic.ttf
Folder: C:\Users\YourName\Downloads\Fonts\OpenSans
✓ OpenSans-Regular.ttf
✓ OpenSans-Bold.ttf
============================================================
🎉 Font installation completed!
📝 Note: You may need to restart applications to see new fonts.
-
Extract zip files in current directory:
python zip_extractor.py
-
Extract zip files in specific folder:
python zip_extractor.py "C:\path\to\your\zip\folder"
-
Linux/macOS example:
python zip_extractor.py "/home/user/Downloads"
Example 1: Current directory
cd C:\Downloads
python zip_extractor.py
Example 2: Specific folder
python zip_extractor.py "C:\Users\YourName\Documents\Archives"
Before extraction:
my_folder/
├── documents.zip
├── photos.zip
└── projects.zip
After running the script:
my_folder/
├── documents.zip
├── documents/ # ← Contents of documents.zip
│ ├── file1.pdf
│ └── file2.docx
├── photos.zip
├── photos/ # ← Contents of photos.zip
│ ├── image1.jpg
│ └── image2.png
├── projects.zip
└── projects/ # ← Contents of projects.zip
├── project1/
└── project2/
Zip File Extractor
Processing folder: C:\Users\YourName\Downloads
--------------------------------------------------
2024-01-15 14:30:25 - INFO - Found 3 zip file(s) to process
2024-01-15 14:30:25 - INFO - Processing: documents.zip
2024-01-15 14:30:25 - INFO - Created/verified folder: C:\Users\YourName\Downloads\documents
2024-01-15 14:30:26 - INFO - Successfully extracted 5 file(s) from documents.zip
2024-01-15 14:30:26 - INFO - Processing: photos.zip
2024-01-15 14:30:26 - INFO - Created/verified folder: C:\Users\YourName\Downloads\photos
2024-01-15 14:30:27 - INFO - Successfully extracted 12 file(s) from photos.zip
==================================================
EXTRACTION SUMMARY
==================================================
Total zip files processed: 3
Successfully extracted: 2
Failed extractions: 1
Detailed Results:
------------------------------
✓ documents.zip → C:\Users\YourName\Downloads\documents (5 files)
✓ photos.zip → C:\Users\YourName\Downloads\photos (12 files)
✗ corrupted.zip - Error: Invalid zip file
==================================================
-
Run diagnostics on Bluetooth audio device:
.\bluetooth_audio_diagnostics.ps1
Note: Must be run as Administrator in PowerShell.
The diagnostics script performs 11 comprehensive checks:
- Current default audio device details
- All playback devices with their status
- Specific device volume levels
- PnP device status and problem codes
- Bluetooth audio driver status
- A2DP profile availability
- Audio device driver information
- System audio configuration (registry)
- Device ID retrieval for manual checks
- Device switching capability test
- Error codes and device problems
========================================
Deep Audio Diagnostics
========================================
[1] Current Default Device - Full Details:
Device: Soundbar (S6520)
Volume: 45%
Muted: False
[2] All Playback Devices with Status:
Index Default Name DeviceState
----- ------- ---- -----------
1 True Soundbar (S6520) Active
2 False Speakers Active
[10] Testing Device Switching:
Current device: Soundbar (S6520)
Attempting to switch to device Index 2...
Switched to: Speakers
Switching back to S6520...
Current device: Soundbar (S6520)
Device switching works!
========================================
Diagnostics Complete!
========================================
-
Apply automated fixes:
.\bluetooth_audio_fix.ps1
Note: Must be run as Administrator in PowerShell.
The fix script applies 5 different fixes automatically:
- A2DP Driver Reset: Disables and re-enables the Bluetooth A2DP audio driver
- Audio Endpoint Reset: Resets the audio endpoint configuration
- Bluetooth Services Restart: Restarts Bluetooth Support and Audio Gateway services
- Audio Services Restart: Restarts Windows Audio and Audio Endpoint Builder services
- Default Device Reset: Forces the device to be set as default again
========================================
Advanced Bluetooth Audio Fix
========================================
[Fix 1] Resetting Bluetooth Audio Driver (A2DP)...
Found S6520 A2DP device. Resetting...
Disabled A2DP driver.
Re-enabled A2DP driver.
[Fix 2] Resetting Audio Endpoint...
Found S6520 audio endpoint. Resetting...
Disabled audio endpoint.
Re-enabled audio endpoint.
[Fix 3] Restarting Bluetooth Services...
Bluetooth Support Service restarted.
Bluetooth Audio Gateway Service restarted.
[Fix 4] Restarting Audio Services...
Audio services restarted.
[Fix 5] Setting S6520 as default device...
S6520 set as default.
[Verification] Checking S6520 status now:
Current Device: Soundbar (S6520)
Volume: 50%
Muted: False
✓ Volume is now readable! Audio stream should work.
========================================
Fixes Applied!
========================================
Next Steps:
1. Test audio NOW (play YouTube video, etc.)
2. If still not working, the Bluetooth connection may need to be removed:
- Go to Settings > Bluetooth & devices
- Find S6520 and click 'Remove device'
- Turn off/on the speaker and re-pair it
3. Check if your soundbar has multiple audio modes (stereo/surround)
- Some modes don't work properly with Windows Bluetooth
Both utilities include comprehensive error handling:
- Invalid or corrupted font files
- Permission issues (warns if not running as admin)
- Registry access errors
- File system errors
- Font already installed detection
- Invalid or corrupted zip files
- Permission denied errors
- File system errors
- Missing directory errors
- Missing AudioDeviceCmdlets module
- Insufficient permissions (requires Administrator)
- Device not found or disconnected
- Service restart failures
- Driver enable/disable errors
- Font Installer: Requires
pywin32
(see requirements.txt) - Zip Extractor: No external dependencies (uses Python standard library)
- Bluetooth Audio Scripts: Requires
AudioDeviceCmdlets
PowerShell module
Install Python dependencies:
pip install -r requirements.txt
Install PowerShell module (as Administrator):
Install-Module -Name AudioDeviceCmdlets
The font_installer.py
uses multiple installation methods in order of preference:
- Windows Shell COM: Uses
install_font_shell_com
with automatic elevation handling - Direct File Operations: Uses
install_font_powershell
to avoid system dialogs - Copy & Registry: Uses
install_font_copy
for manual installation - Windows API: Falls back to
ctypes.windll.gdi32.AddFontResourceW
if needed
is_admin()
: Checks for administrator privilegesis_font_installed()
: Detects if font is already installedinstall_font()
: Main installation function with multiple methodsfind_font_files()
: Recursively finds all font filesinstall_fonts_from_folder()
: Batch processes fonts from folder
extract_zip_files()
: Main extraction functionprint_summary()
: Displays detailed extraction results
- Diagnostics: 11 comprehensive checks covering devices, drivers, services, and configuration
- Fix Script: 5 automated fixes for common Bluetooth audio issues
- Both scripts include color-coded output for easy reading and status verification
Both utilities use Python's logging
module for progress tracking:
- INFO: Standard operation messages
- DEBUG: Verbose mode (use
--verbose
flag for Font Installer) - ERROR: Error messages and failures
- WARNING: Non-critical issues
.ttf
- TrueType Font.otf
- OpenType Font.ttc
- TrueType Collection.fon
- Bitmap Font.fnt
- Bitmapped Font
.zip
- Standard ZIP archives
- Works with all Bluetooth audio devices
- Specifically tested with A2DP audio profile
- Supports stereo and headset profiles
Problem: "This script is not running with administrator privileges"
- Solution: Right-click Command Prompt/PowerShell and select "Run as Administrator"
Problem: "All installation methods failed"
- Solution: Ensure you have admin rights and the font file is not corrupted
Problem: Font shows as installed but doesn't appear in applications
- Solution: Restart the application or log out and log back in
Problem: "Invalid zip file" error
- Solution: The zip file may be corrupted. Try downloading it again
Problem: "Permission denied" error
- Solution: Check that you have write permissions for the target folder
Problem: Extracted folder is empty
- Solution: The zip file may be password-protected or empty
Problem: "Module AudioDeviceCmdlets not found"
- Solution: Install the module:
Install-Module -Name AudioDeviceCmdlets
(as Administrator)
Problem: "Access Denied" or permission errors
- Solution: Run PowerShell as Administrator (right-click PowerShell → Run as Administrator)
Problem: Diagnostics show "Volume: " (blank)
- Solution: Run the fix script - this indicates audio stream isn't working properly
Problem: Device shows in list but no audio plays
- Solution: Try the fix script, then check Volume Mixer to ensure app-specific volume isn't at 0
Problem: Fixes don't work
- Solution:
- Remove the Bluetooth device from Settings
- Turn off the Bluetooth speaker/headphones
- Re-pair the device
- Run the diagnostics script again
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
This project is open source. Please check the repository for license information.
LiteObject
- Python utilities built with Python's standard library and pywin32
- PowerShell scripts utilize AudioDeviceCmdlets module
- Designed for Windows system administrators and power users
If you encounter issues or have questions:
- Check the Troubleshooting section above
- Run the diagnostics scripts for detailed information
- Open an issue on GitHub with diagnostic output
Utility | Language | Purpose | Admin Required |
---|---|---|---|
Font Installer | Python | Batch install fonts from folders | Recommended |
Zip Extractor | Python | Batch extract zip files | No |
Bluetooth Audio Diagnostics | PowerShell | Diagnose Bluetooth audio issues | Yes |
Bluetooth Audio Fix | PowerShell | Fix common Bluetooth audio problems | Yes |