From 23527db27fd59f1c57072b1c39d24c51d3e67d40 Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Fri, 12 Jun 2026 18:19:56 -0600 Subject: [PATCH] 1781309997 --- Windows-Scripts/windows-repair.ps1 | 58 ++++++++++++++++-------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/Windows-Scripts/windows-repair.ps1 b/Windows-Scripts/windows-repair.ps1 index 55b9e57..2d84639 100644 --- a/Windows-Scripts/windows-repair.ps1 +++ b/Windows-Scripts/windows-repair.ps1 @@ -5,42 +5,48 @@ # alt+y # Run: # In powershell Terminal: -# iwr -UseBasicParsing -Uri "https://git.thecoven.info/PrincessPi/general-scripts-and-system-ssssssetup/raw/branch/main/Windows-Scripts/windows-repair.ps1?nocache=$(Get-Random)" -OutFile "$env:TEMP\windows-repair2.ps1"; &"$env:TEMP\windows-repair2.ps1" +# iwr -UseBasicParsing -Uri "https://git.thecoven.info/PrincessPi/general-scripts-and-system-ssssssetup/raw/branch/main/Windows-Scripts/windows-repair.ps1?nocache=$(Get-Random)" -OutFile "$env:TEMP\windows-repair3.ps1"; &"$env:TEMP\windows-repair3.ps1" +# check if hasadmin rights, if notm run script in new terminal, clopsing old +## if not, carry on if (-not ([Security.Principal.WindowsIdentity]::GetCurrent().Groups -contains 'S-1-5-32-544')) { - Start-Process -FilePath 'powershell' -Verb RunAs -ArgumentList " -ExecutionPolicy Bypass -File $PSCommandPath" -} + # launch tghis script int new window after promopting for admin + Start-Process -FilePath 'powershell' -Verb RunAs -ArgumentList "-ExecutionPolicy Bypass -File $PSCommandPath" -Write-Host "`nFIXING WINDOWS FULL STYLE`n" + # CLOSE previous terminal + exit 0 +} else { + Write-Host "`nFIXING WINDOWS FULL STYLE`n" -Write-Host "ABORTING ANY SCHEDULED SHUTDOWN" -shutdown /a | Out-Null # cmd abort scheduled shutdowns + Write-Host "ABORTING ANY SCHEDULED SHUTDOWN" + shutdown /a | Out-Null # cmd abort scheduled shutdowns -Write-Host "Clearing DNS" -ipconfig /flushsdns | Out-Null + Write-Host "Clearing DNS" + ipconfig /flushsdns | Out-Null -Write-Host "Clearing ARP Cache" -Remove-NetNeighbor -Confirm:$false | Out-Null + Write-Host "Clearing ARP Cache" + Remove-NetNeighbor -Confirm:$false | Out-Null -Write-Host "Renewing DHCP" -ipconfig /releasen | Out-Null -ipconfig /renew | Out-Null + Write-Host "Renewing DHCP" + ipconfig /releasen | Out-Null + ipconfig /renew | Out-Null -Write-Host "LAUNCHING WINDOWS MALICIOUS SOFTWARE REMOVAL TOOL (MRT) FOLLOW DIRECTIONS FOR FULL SCAN" -# mrt # builtin malware removal tools -Start-Process -FilePath "MRT.exe" -Verb RunAs -Wait # pause until mrt is done + Write-Host "LAUNCHING WINDOWS MALICIOUS SOFTWARE REMOVAL TOOL (MRT) FOLLOW DIRECTIONS FOR FULL SCAN" + # mrt # builtin malware removal tools + Start-Process -FilePath "MRT.exe" -Verb RunAs -Wait # pause until mrt is done -Write-Host "RUNNING DISM ONLINE IMAGE CLEANUP" -Start-Process -FilePath "DISM.exe" -Verb RunAs -ArgumentList "/Online /Cleanup-Image /RestoreHealth" -Wait # powershell checks image and replaces bad filesm waits to fimish + Write-Host "RUNNING DISM ONLINE IMAGE CLEANUP" + Start-Process -FilePath "DISM.exe" -Verb RunAs -ArgumentList "/Online /Cleanup-Image /RestoreHealth" -Wait # powershell checks image and replaces bad filesm waits to fimish -Write-Host "LAUNCHING SYSTEM FILE CHECKER (SFC)" -Start-Process "SFC.exe" -Verb RunAs -ArgumentList "/scannow" -Wait # cmd system file checker, retreives and replaces bad system files and waits fir it to finish + Write-Host "LAUNCHING SYSTEM FILE CHECKER (SFC)" + Start-Process "SFC.exe" -Verb RunAs -ArgumentList "/scannow" -Wait # cmd system file checker, retreives and replaces bad system files and waits fir it to finish -Write-Host "SCHEDULING OFFLINE CHECK DISK AND REPAIR OF C: (CHKDSK)" -Start-Process "cmd.exe" -Verb RunAs -ArgumentList "-c 'echo y | chkdsk /f /r C:'" # cmd checks C drive after reboot to waste time and fix errors (noninteractive) + Write-Host "SCHEDULING OFFLINE CHECK DISK AND REPAIR OF C: (CHKDSK)" + Start-Process "cmd.exe" -Verb RunAs -ArgumentList "-c 'echo y | chkdsk /f /r C:'" # cmd checks C drive after reboot to waste time and fix errors (noninteractive) -Write-Host "SCHEDULING WINDOWS DEFENDER OFFLINE SCAN MAY REBOOT UNEXPECTEDL" -Start-MpWDOScan # powershell starts Windows Defender Offline Scan after reboot + Write-Host "SCHEDULING WINDOWS DEFENDER OFFLINE SCAN MAY REBOOT UNEXPECTEDL" + Start-MpWDOScan # powershell starts Windows Defender Offline Scan after reboot -Write-Host "`nREBOOTING IN 5 MINUTES MAX PROVBABLY SOONER`n" -shutdown /r /t 300 \ No newline at end of file + Write-Host "`nREBOOTING IN 5 MINUTES MAX PROVBABLY SOONER`n" + shutdown /r /t 300 +} \ No newline at end of file