@echo off :: Version 1.02 19.06.2025 Janno :: * No need to run as admin - it will ask permissions if needed :: * Will schedule disk check for next reboot :: * Will check for system file problems :: * Will check for nvidia driver updates and installs them :: * Enables virtualization support :: * Updates WSL to latest version :: * Will check for windows updates and installs all updates (reboots in the end if needed) :: * If machine is not rebooted automatically, manual reboot is recommended so that disk check would run :: Check for elevation and relaunch if not admin net session >nul 2>&1 if %errorlevel% neq 0 ( powershell -Command "Start-Process -FilePath '%~f0' -Verb RunAs" exit /b ) echo Running CHKDSK with auto-confirm for reboot scan... REM echo Y | chkdsk C: /f :: Standard commands REM sfc /scannow wsl --update :: Install Chocolatey powershell -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" :: Force install NuGet provider (for PowerShell modules) powershell -Command "Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force" :: Upgrade NVIDIA driver ::powershell -Command "choco upgrade nvidia-display-driver -y" "C:\ProgramData\chocolatey\bin\choco.exe" upgrade nvidia-display-driver -y :: Enable VirtualMachinePlatform for WSL2 dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart :: Install and use PSWindowsUpdate module powershell -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; Install-Module -Name PSWindowsUpdate -Force -SkipPublisherCheck" powershell -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; Import-Module PSWindowsUpdate; $updatesCount = (Get-WindowsUpdate -MicrosoftUpdate).Count; Write-Output 'There are ' + $updatesCount + ' updates available.'; Get-WindowsUpdate -MicrosoftUpdate -AcceptAll -Install -AutoReboot" pause