@echo off :: https://privacy.sexy — v0.8.1 — Tue, 01 Dec 2020 15:24:55 GMT :: ---------------------------------------------------------- :: -----------------Ensure admin privileges------------------ :: ---------------------------------------------------------- echo --- Ensure admin privileges fltmc >nul 2>&1 || ( echo Administrator privileges are required. PowerShell Start -Verb RunAs '%0' 2> nul || ( echo Right-click on the script and select "Run as administrator". pause & exit 1 ) exit 0 ) :: ---------------------------------------------------------- :: ---------------------------------------------------------- :: ------------------Settings app (revert)------------------- :: ---------------------------------------------------------- echo --- Settings app (revert) PowerShell -Command " $package = (Get-AppxPackage -AllUsers 'Windows.immersivecontrolpanel'); if (!$package) { Write-Error 'App could not be found' -ErrorAction Stop; } $directories = @($package.InstallLocation, \"$env:LOCALAPPDATA\Packages\$($package.PackageFamilyName)\"); foreach($dir in $directories) { if ( !$dir -Or !(Test-Path \"$dir\") ) { continue; } cmd /c takeown /f \"$dir\" /r /d y | Out-Null; cmd /c icacls \"$dir\" /grant administrators:F /t | Out-Null; $files = Get-ChildItem -File -Path \"$dir\*.OLD\" -Recurse -Force; foreach($file in $files) { $newName = $file.FullName.Substring(0, $file.FullName.Length - 4); Write-Host \"Rename '$($file.FullName)' to '$newName'\"; Move-Item -LiteralPath \"$($file.FullName)\" -Destination \"$newName\" -Force; } }; " :: ---------------------------------------------------------- pause exit /b 0