Skip to content

Windows offline error #24

@rd842003

Description

@rd842003

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 #####

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions