A comprehensive collection of Windows batch scripts for system maintenance and management tasks. These scripts leverage modern PowerShell cmdlets for enhanced compatibility and reliability.
- Modern PowerShell Integration: All scripts use current Windows commands and PowerShell cmdlets
- User-Friendly Design: Colorful interfaces with titles and clear instructions
- Comprehensive Coverage: 16 scripts covering disk management, system optimization, security, and more
- GitHub Ready: Includes README, LICENSE, and .gitignore for easy sharing
Displays disk space usage for all drives in GB.
- Usage: Run as administrator for full access.
- Command:
powershell -command "Get-WmiObject -Class Win32_LogicalDisk | Select-Object DeviceID, @{Name='Size(GB)';Expression={[math]::Round($_.Size/1GB,2)}}, @{Name='FreeSpace(GB)';Expression={[math]::Round($_.FreeSpace/1GB,2)}} | Format-Table -AutoSize"
Synchronizes system time with Windows Time service.
- Usage: Requires administrator privileges.
- Command:
w32tm /resync(with error handling)
Lists all running processes with CPU and memory usage.
- Usage: No special privileges required.
- Command:
powershell -command "Get-Process | Select-Object ProcessName, Id, CPU, Memory"
Creates a system restore point.
- Usage: Requires administrator privileges.
- Command:
powershell -command "Checkpoint-Computer -Description 'Manual Restore Point'"
Defragments the C: drive.
- Usage: Requires administrator privileges.
- Command:
powershell -command "Optimize-Volume -DriveLetter C -Defrag"
Empties the Recycle Bin.
- Usage: No special privileges required.
- Command:
powershell -command "Clear-RecycleBin -Force"
Checks for available Windows updates.
- Usage: No special privileges required.
- Command:
powershell -command "try { Get-HotFix | Select-Object HotFixID, Description, InstalledOn | Format-Table -AutoSize } catch { Write-Host 'Error checking updates.' }"
Exports the HKLM registry hive to a file.
- Usage: Requires administrator privileges.
- Command:
powershell -command "reg export HKLM registry_backup_$(Get-Date -Format yyyyMMdd).reg"
Shuts down the computer after 60 seconds.
- Usage: No special privileges required.
- Command:
powershell -command "Stop-Computer -Force -Delay 60"
Displays the last 10 system events.
- Usage: No special privileges required.
- Command:
powershell -command "Get-EventLog -LogName System -Newest 10"
Shows the system boot time.
- Usage: No special privileges required.
- Command:
powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTime"
Disables the Windows Firewall.
- Usage: Requires administrator privileges.
- Command:
powershell -command "Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False"
Lists all installed programs.
- Usage: No special privileges required.
- Command:
powershell -command "Get-WmiObject -Class Win32_Product | Select-Object Name"
Creates a new local user account.
- Usage: Requires administrator privileges.
- Command:
powershell -command "New-LocalUser -Name 'NewUser' -Password (ConvertTo-SecureString 'Password123' -AsPlainText -Force) -FullName 'New User' -Description 'Created by script'"
Displays active network connections.
- Usage: No special privileges required.
- Command:
powershell -command "Get-NetTCPConnection | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State"
Clears RAM cache using garbage collection and system idle tasks.
- Usage: No special privileges required.
- Command:
powershell -command "try { Clear-Host; [System.GC]::Collect(); [System.GC]::WaitForPendingFinalizers(); rundll32.exe advapi32.dll,ProcessIdleTasks; Write-Host 'RAM cache cleared.' } catch { Write-Host 'Error clearing RAM cache.' }"
- Operating System: Windows 10 or later
- PowerShell: Version 5.1 or higher
- Privileges: Administrator privileges for scripts that modify system settings
- Clone or Download: Get the repository files
- Run Scripts: Execute the desired .bat file
- Admin Rights: Use "Run as administrator" for system-modifying scripts
- Review Output: Check the results and take appropriate actions
- Admin Privileges: Some scripts require administrator privileges to execute successfully
- Backup Data: Always backup important data before running system modification scripts
- Educational Purpose: These scripts are for educational and maintenance purposes
- Use with Caution: Test scripts in a safe environment first
Feel free to suggest improvements or add new scripts! Fork the repository and submit a pull request.
For detailed guidelines, see our Contributing Guide.
We are committed to fostering an open and welcoming community. Please read our Code of Conduct to understand the standards we uphold.
We take security seriously. If you discover a vulnerability, please report it according to our Security Policy.
This project is licensed under the MIT License - see the LICENSE file for details.
β Star this repository if you find it useful!