-
Notifications
You must be signed in to change notification settings - Fork 311
Description
I ran the following Powershell script and now I cant log back into my windows account. Any idea?
2 $objShell = New-Object -ComObject Shell.Application
3 $objFolder = $objShell.Namespace(0xA)
4 $WinTemp = "c:\Windows\Temp*"
5
6 #1# Empty Recycle Bin #
7 write-Host "Emptying Recycle Bin." -ForegroundColor Cyan
8 $objFolder.items() | %{ remove-item $_.path -Recurse -Confirm:$false}
9
10 #2# Remove Temp
11 write-Host "Removing Temp" -ForegroundColor Green
12 Set-Location “C:\Windows\Temp”
13 Remove-Item * -Recurse -Force -ErrorAction SilentlyContinue
14
15 Set-Location “C:\Windows\Prefetch”
16 Remove-Item * -Recurse -Force -ErrorAction SilentlyContinue
17
18 Set-Location “C:\Documents and Settings”
19 Remove-Item “.*\Local Settings\temp*” -Recurse -Force -ErrorAction SilentlyContinue
20
21 Set-Location “C:\Users”
22 Remove-Item “.*\Appdata\Local\Temp*” -Recurse -Force -ErrorAction SilentlyContinue
23
24 #3# Running Disk Clean up Tool
25 write-Host "Finally now , Running Windows disk Clean up Tool" -ForegroundColor Cyan
26 cleanmgr /sagerun:1 | out-Null
27
28 $([char]7)
29 Sleep 3
30 write-Host "I finished the cleanup task,Bye Bye " -ForegroundColor Yellow
31 Sleep 3
32 ##### End of the Script #####