Skip to content

Commit

Permalink
Downloaded Installations, SoftwareDistribution, PatchCache: moved out…
Browse files Browse the repository at this point in the history
… of "hardcore"
  • Loading branch information
justdanpo committed Mar 19, 2016
1 parent a42fe74 commit ea7cf5a
Showing 1 changed file with 26 additions and 27 deletions.
53 changes: 26 additions & 27 deletions JustCleaner.bat
Expand Up @@ -130,35 +130,34 @@ ls $env:windir\Installer\*.msi,$env:windir\Installer\*.msp |% {
}
$total += $msplen

# --------------------------------------------------------------
if($env:cbsclear_args -imatch "hardcore") {

#-Downloaded Installations------------------------------------
$dl1len = RemoveProtectedRecursiveAndGetLen "$env:windir\Downloaded Installations"
$total += $dl1len

#-SoftwareDistribution----------------------------------------
$wuauservWasStarted = (Get-Service -Name wuauserv).Status -ieq "running"
$bitsWasStarted = (Get-Service -Name bits).Status -ieq "running"
if ($wuauservWasStarted) {
net.exe stop wuauserv
}
if ($bitsWasStarted) {
net.exe stop bits
}
$dl2len = RemoveProtectedRecursiveAndGetLen "$env:windir\SoftwareDistribution\Download"
$total += $dl2len
if ($wuauservWasStarted) {
net.exe start wuauserv
}
if ($bitsWasStarted) {
net.exe start bits
}
#-Downloaded Installations------------------------------------
$dl1len = RemoveProtectedRecursiveAndGetLen "$env:windir\Downloaded Installations"
$total += $dl1len

#-SoftwareDistribution----------------------------------------
$wuauservWasStarted = (Get-Service -Name wuauserv).Status -ieq "running"
$bitsWasStarted = (Get-Service -Name bits).Status -ieq "running"
if ($wuauservWasStarted) {
net.exe stop wuauserv
}
if ($bitsWasStarted) {
net.exe stop bits
}
$dl2len = RemoveProtectedRecursiveAndGetLen "$env:windir\SoftwareDistribution\Download"
$total += $dl2len
if ($wuauservWasStarted) {
net.exe start wuauserv
}
if ($bitsWasStarted) {
net.exe start bits
}

#-$PatchCache$------------------------------------------------
$pcslen = RemoveProtectedRecursiveAndGetLen "$env:windir\Installer\`$PatchCache`$\Managed"
$total += $pcslen
#-$PatchCache$------------------------------------------------
$pcslen = RemoveProtectedRecursiveAndGetLen "$env:windir\Installer\`$PatchCache`$\Managed"
$total += $pcslen

# --------------------------------------------------------------
if($env:cbsclear_args -imatch "hardcore") {
}

# --------------------------------------------------------------
Expand Down

0 comments on commit ea7cf5a

Please sign in to comment.