2016-08: Retroactive Updates

* Added OutlookAttachView

* Added PerfMonitor2

* CHKDSK
  * Will use the newer repair features on Windows 8 or newer

* MailPassView & ProduKey
  * Now saved in a 7-Zip encrypted archive to avoid deletion by AV

* SW Checklist / Diagnostics
  * Windows 10 Blocked automatically
    * (Too late but whatevs it was in testing before the cutoff)

* Bugfixes
  * Activate Windows (with BIOS key)
    * Wasn't extracting ProduKey before trying to run it
  * SW Diagnostics
    * Should now report the preview size from BleachBit correctly
This commit is contained in:
Alan Mason 2017-11-17 00:51:23 -07:00
parent 3031df5a4c
commit a4c0c487ff
15 changed files with 182 additions and 88 deletions

View file

@ -7,11 +7,17 @@ pushd "$wd"
clear
$host.UI.RawUI.WindowTitle = "WK Check Disk Tool"
## Schedule CHKDSK ##
# OS Check
. .\os_check.ps1
## Run Scan (read-only) ##
write-host "$systemdrive (System Drive)"
start -wait "chkdsk" -argumentlist @("/f", "$systemdrive") -nonewwindow
if ($win_version -match '^(8|10)$') {
start -wait "chkdsk" -argumentlist @("$systemdrive", "/scan", "/perf") -nonewwindow
} else {
start -wait "chkdsk" -argumentlist @("$systemdrive") -nonewwindow
}
## Done ##
popd
pause "Press Enter to reboot..."
restart-computer
pause "Press Enter to exit..."

View file

@ -0,0 +1,28 @@
# WK-Check Disk
## Init ##
$wd = $(Split-Path $MyInvocation.MyCommand.Path)
pushd "$wd"
. .\init.ps1
clear
$host.UI.RawUI.WindowTitle = "WK Check Disk Tool"
# OS Check
. .\os_check.ps1
## Run Scan (fix) ##
write-host "$systemdrive (System Drive)"
if ($win_version -match '^(8|10)$') {
if (ask("Run Spot-fix and security cleanup?")) {
start -wait "chkdsk" -argumentlist @("$systemdrive", "/sdcleanup", "/spotfix") -nonewwindow
} else if (ask("Run full offline scan?")) {
start -wait "chkdsk" -argumentlist @("$systemdrive", "/offlinescanandfix") -nonewwindow
}
} else {
start -wait "chkdsk" -argumentlist @("$systemdrive", "/F") -nonewwindow
}
## Done ##
popd
pause "Press Enter to reboot..."
restart-computer

View file

@ -103,6 +103,21 @@ if (test-path "$programfiles\SUPERAntiSpyware") {
}
}
## Block Windows 10 ##
if ($win_version -notmatch '^10$') {
# Kill GWX
taskkill /f /im gwx.exe
# Block upgrade via registry
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" -Force 2>&1 | out-null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" -Name "AllowOSUpgrade" -Value 0 -Type "DWord" | out-null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" -Name "ReservationsAllowed" -Value 0 -Type "DWord" | out-null
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Gwx" -Force 2>&1 | out-null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Gwx" -Name "DisableGwx" -Value 1 -Type "DWord" | out-null
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Force 2>&1 | out-null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "DisableOSUpgrade" -Value 1 -Type "DWord" | out-null
}
## Summary ##
wk-write "" "$log"
wk-write "Starting SW Checklist" "$log"
@ -229,7 +244,7 @@ if ($arch -eq 64) {
start $prog
# XMPlay
start "$WKPath\Tools\Misc\XMPlay.cmd"
start "$bin\..\Misc\XMPlay.cmd"
## Upload info ##
write-host "Uploading info to NAS..."

View file

@ -59,9 +59,9 @@ if (!(ask "Did RKill run correctly?" "$log")) {
# TDSSKiller Rootkit scan
wk-write "* Running Rootkit scan" "$log"
if (test-path "$WKPath\Tools\.bin\TDSSKiller.exe") {
if (test-path "$bin\TDSSKiller.exe") {
md "$WKPath\Quarantine\TDSSKiller" 2>&1 | out-null
start -wait "$WKPath\Tools\.bin\TDSSKiller.exe" -argumentlist @("-l", "$logpath\TDSSKiller.log", "-qpath", "$WKPath\Quarantine\TDSSKiller", "-accepteula", "-accepteulaksn", "-dcexact", "-tdlfs")
start -wait "$bin\TDSSKiller.exe" -argumentlist @("-l", "$logpath\TDSSKiller.log", "-qpath", "$WKPath\Quarantine\TDSSKiller", "-accepteula", "-accepteulaksn", "-dcexact", "-tdlfs")
} else {
wk-error " TDSSKiller.exe missing. Please verify Wizard-Kit was copied correctly."
}
@ -165,8 +165,7 @@ if (!(test-path "$logpath\bleachbit.log")) {
# Autoruns
if (!(test-path "$logpath\autoruns.arn")) {
wk-write "* Starting background autoruns scan" "$log"
New-Item "HKCU:\Software\Sysinternals" 2>&1 | out-null
New-Item "HKCU:\Software\Sysinternals\AutoRuns" 2>&1 | out-null
New-Item -Path "HKCU:\Software\Sysinternals\AutoRuns" -Force 2>&1 | out-null
Set-ItemProperty -Path "HKCU:\Software\Sysinternals\AutoRuns" -Name "checkvirustotal" -Value 1 -Type "DWord" | out-null
Set-ItemProperty -Path "HKCU:\Software\Sysinternals\AutoRuns" -Name "EulaAccepted" -Value 1 -Type "DWord" | out-null
Set-ItemProperty -Path "HKCU:\Software\Sysinternals\AutoRuns" -Name "shownomicrosoft" -Value 1 -Type "DWord" | out-null
@ -223,12 +222,27 @@ if (!(test-path "$logpath\keys.txt")) {
start -wait $prog -argumentlist @("/nosavereg", "/stext", "$logpath\keys.txt") -workingdirectory "$bin\ProduKey"
}
## Block Windows 10 ##
if ($win_version -notmatch '^10$') {
# Kill GWX
taskkill /f /im gwx.exe
# Block upgrade via registry
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" -Force 2>&1 | out-null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" -Name "AllowOSUpgrade" -Value 0 -Type "DWord" | out-null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" -Name "ReservationsAllowed" -Value 0 -Type "DWord" | out-null
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Gwx" -Force 2>&1 | out-null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Gwx" -Name "DisableGwx" -Value 1 -Type "DWord" | out-null
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Force 2>&1 | out-null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "DisableOSUpgrade" -Value 1 -Type "DWord" | out-null
}
## Summary ##
wk-write "" "$log"
# Removed temp file size
wk-write "==== Temp Files ====" "$log"
$bb = (gc "$logpath\bleachbit.log") -imatch '(disk space recovered|files deleted)'
$bb = (gc "$logpath\bleachbit.log") -imatch '^(disk space.*recovered|files.*deleted)'
foreach ($_ in $bb) {
$_ = " " + $_
wk-write $_ "$log"
@ -295,7 +309,7 @@ wk-write "" "$log"
# Updates Check
# TODO: Finish and test this
#wk-write "==== Windows Updates ====" "$log"
#import-module "$WKPath\Tools\.bin\Scripts\PSWindowsUpdate"
#import-module "$bin\Scripts\PSWindowsUpdate"
# Check last install date
#get-wuhistory | sort-object date -descending | select-object -first 1
# Check if installs CS

View file

@ -5,5 +5,13 @@ for %%f in (%*) do (
if /i "%%f" == "/DEBUG" (@echo on)
)
:Extract
pushd %~dp0\..\.bin
cls
mkdir "ProduKey" >nul 2>&1
7-Zip\7z.exe x ProduKey.7z -oProduKey -aos -pAbracadabra -bsp0 -bso0
ping -n 1 127.0.0.1>nul
popd
:Launch
call "%~dp0\.bin\Scripts\Launch.cmd" PSScript "%~dp0\.bin\Scripts" "activate.ps1" /admin

View file

@ -8,7 +8,7 @@ for %%f in (%*) do (
:Init
setlocal EnableDelayedExpansion
title WK Tools Copier
title Wizard Kit Copier
color 1b
echo Initializing...
@ -23,61 +23,11 @@ rem :TestSource above runs pushd, so %cd% should be accurate.
set "source=%cd%"
set "dest=%systemdrive%\WK\Tools"
:OS-Check
set "os_supported="
for /f "tokens=3*" %%v in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion 2^>nul') do (set "win_ver=%%v")
for /f "tokens=3*" %%b in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CurrentBuildNumber 2^>nul') do (set "win_build=%%b")
if "!win_ver!" == "6.0" (
set "os_supported=true"
set "win_version=Vista"
)
if "!win_ver!" == "6.1" (
set "os_supported=true"
set "win_version=7"
)
if "!win_ver!" == "6.2" (
set "os_supported=true"
set "win_version=8"
)
if "!win_ver!" == "6.3" (
set "os_supported=true"
set "win_version=8"
if "!win_build!" == "10240" (
set "win_version=10"
)
if "!win_build!" == "10586" (
set "win_version=10"
)
)
rem !win_ver!.!win_build!
rem == vista ==
rem 6.0.6000
rem 6.0.6001
rem 6.0.6002
rem ==== 7 ====
rem 6.1.7600
rem 6.1.7601
rem 6.1.7602
rem ==== 8 ====
rem 6.2.9200
rem === 8.1 ===
rem 6.3.9200
rem === 8.1u ==
rem 6.3.9600
rem === 10 ==
rem 6.3.10240
rem === 10 v1511 ==
rem 6.3.10586
if not defined os_supported (goto WindowsVersionError)
:CreateToolsFolder
mkdir "!dest!" > nul 2>&1
:: .bin folder ::
set "args=/xd Scripts"
set "args="
call :RoboCopy "!source!\.bin" "!dest!\.bin" "" "!args!"
:: RKill Alternatives ::
@ -90,18 +40,17 @@ mklink /h uSeRiNiT.exe RKill.exe
mklink /h WiNlOgOn.exe RKill.exe
popd
:: Scripts ::
set "args=/xf update-tools
:: Root files ::
set "args="
call :RoboCopy "!source!\.bin\Scripts" "!dest!\.bin\Scripts" "" "!args!"
if !win_version! equ 8 (copy /y "!source!\Activate Windows 8.cmd" "!dest!\")
if !win_version! equ 10 (copy /y "!source!\Activate Windows 8.cmd" "!dest!\Activate Windows (with BIOS key).cmd")
copy /y "!source!\Activate Windows (with BIOS key).cmd" "!dest!\"
copy /y "!source!\Battery Health.cmd" "!dest!\"
copy /y "!source!\Enter SafeMode.cmd" "!dest!\"
copy /y "!source!\Exit SafeMode.cmd" "!dest!\"
copy /y "!source!\Final Checklist.cmd" "!dest!\"
copy /y "!source!\Hide Windows 10 Upgrade.reg" "!dest!\"
copy /y "!source!\Reset Browsers.cmd" "!dest!\"
move /y "!dest!\.bin\Scripts\Final Checklist.cmd" "!dest!\"
move /y "!dest!\.bin\Scripts\SW Diagnostics.cmd" "!dest!\"
copy /y "!source!\SW Diagnostics.cmd" "!dest!\"
:: Data Recovery ::
rem Disabled.

View file

@ -1,14 +1,22 @@
@echo off
:Init
setlocal enabledelayedexpansion
pushd %~dp0\..\.bin
:Flags
for %%f in (%*) do (
if /i "%%f" == "/DEBUG" (@echo on)
)
:Extract
mkdir "%~dp0\..\.bin\mailpv" >nul 2>&1
call "%~dp0\..\.bin\Scripts\Launch.cmd" Program "%~dp0\..\.bin" "%~dp0\..\.bin\7-Zip\7z.exe" "x mailpv.7z -omailpv -aos -Abracadabra" /wait
mkdir "mailpv" >nul 2>&1
7-Zip\7z.exe x mailpv.7z -omailpv -aos -pAbracadabra -bsp0 -bso0
ping -n 1 127.0.0.1>nul
:Launch
call "%~dp0\..\.bin\Scripts\Launch.cmd" Program "%~dp0\..\.bin\mailpv" "mailpv.exe" "" /admin
call "Scripts\Launch.cmd" Program "mailpv" "mailpv.exe" "" /admin
:Done
popd
endlocal

View file

@ -1,14 +1,22 @@
@echo off
:Init
setlocal enabledelayedexpansion
pushd %~dp0\..\.bin
:Flags
for %%f in (%*) do (
if /i "%%f" == "/DEBUG" (@echo on)
)
:Extract
mkdir "%~dp0\..\.bin\mailpv" >nul 2>&1
call "%~dp0\..\.bin\Scripts\Launch.cmd" Program "%~dp0\..\.bin" "%~dp0\..\.bin\7-Zip\7z.exe" "x mailpv.7z -omailpv -aos -Abracadabra" /wait
mkdir "mailpv" >nul 2>&1
7-Zip\7z.exe x mailpv.7z -omailpv -aos -pAbracadabra -bsp0 -bso0
ping -n 1 127.0.0.1>nul
:Launch
call "%~dp0\..\.bin\Scripts\Launch.cmd" Program "%~dp0\..\.bin\mailpv" "mailpv.exe" ""
call "Scripts\Launch.cmd" Program "mailpv" "mailpv.exe" ""
:Done
popd
endlocal

View file

@ -0,0 +1,22 @@
@echo off
:Init
setlocal enabledelayedexpansion
pushd %~dp0\..\.bin
:Flags
for %%f in (%*) do (
if /i "%%f" == "/DEBUG" (@echo on)
)
:Extract
mkdir "OutlookAttachView" >nul 2>&1
7-Zip\7z.exe x OutlookAttachView.7z -oOutlookAttachView -aos -pAbracadabra -bsp0 -bso0
ping -n 1 127.0.0.1>nul
:Launch
call "Scripts\Launch.cmd" Program "OutlookAttachView" "OutlookAttachView.exe" "" /admin
:Done
popd
endlocal

View file

@ -0,0 +1,22 @@
@echo off
:Init
setlocal enabledelayedexpansion
pushd %~dp0\..\.bin
:Flags
for %%f in (%*) do (
if /i "%%f" == "/DEBUG" (@echo on)
)
:Extract
mkdir "OutlookAttachView" >nul 2>&1
7-Zip\7z.exe x OutlookAttachView.7z -oOutlookAttachView -aos -pAbracadabra -bsp0 -bso0
ping -n 1 127.0.0.1>nul
:Launch
call "Scripts\Launch.cmd" Program "OutlookAttachView" "OutlookAttachView.exe" ""
:Done
popd
endlocal

View file

@ -7,12 +7,15 @@ for %%f in (%*) do (
:Init
setlocal EnableDelayedExpansion
pushd %~dp0\..\.bin
:ClearConfigs
pushd %~dp0\..\.bin\ProduKey
if exist "ProduKey\*.*" (
pushd ProduKey
if exist "ProduKey.cfg" del "ProduKey.cfg"
if exist "ProduKey64.cfg" del "ProduKey64.cfg"
popd
)
:FindHives
set choices=L
@ -38,17 +41,12 @@ if exist "!_P!" (
echo.P: !_P!
)
:Extract
mkdir "%~dp0\..\.bin\ProduKey" >nul 2>&1
call "%~dp0\..\.bin\Scripts\Launch.cmd" Program "%~dp0\..\.bin" "%~dp0\..\.bin\7-Zip\7z.exe" "x ProduKey.7z -oProduKey -aos -pAbracadabra" /wait
ping -n 1 127.0.0.1>nul
:Choose
echo.
set "args="
rem If there are no choices, then don't ask
if "!choices!" == "L" (goto Launch)
if "!choices!" == "L" (goto Extract)
rem pick souce and use response to set sw_hive
choice /c !choices! /t 10 /d l /m "Please select source"
@ -64,8 +62,15 @@ if "!choice!" == "P" (set "sw_hive=!_P!")
rem set args
if !index! neq 0 (set "args=/regfile !sw_hive!")
:Extract
cls
mkdir "ProduKey" >nul 2>&1
7-Zip\7z.exe x ProduKey.7z -oProduKey -aos -pAbracadabra -bsp0 -bso0
ping -n 1 127.0.0.1>nul
:Launch
call "%~dp0\..\.bin\Scripts\Launch.cmd" Program "%~dp0\..\.bin\ProduKey" "ProduKey.exe" "!args!" /admin
:Done
popd
endlocal

View file

@ -8,4 +8,4 @@ for %%f in (%*) do (
:Launch
echo Waiting for software installation to finish...
call "%~dp0\..\.bin\Scripts\Launch.cmd" Program "%~dp0\..\.bin\_Drivers" "HP Support Solutions Framework.exe" "" /admin /wait
start "" "http://h22213.www2.hp.com/ediags/gmd/ProdDetect.aspx?lc=en&cc=us"
start "" "http://support.hp.com/us-en/drivers/selfservice/identify"

9
Misc/PerfMonitor2.cmd Normal file
View file

@ -0,0 +1,9 @@
@echo off
:Flags
for %%f in (%*) do (
if /i "%%f" == "/DEBUG" (@echo on)
)
:Launch
call "%~dp0\..\.bin\Scripts\Launch.cmd" Program "%~dp0\..\.bin\PerfMonitor2" "PerfMonitor2.exe" ""

View file

@ -6,4 +6,4 @@ for %%f in (%*) do (
)
:Launch
call "%~dp0\..\.bin\Scripts\Launch.cmd" Console "%~dp0\..\.bin\Scripts" "check_disk.cmd" "/f" /admin
call "%~dp0\..\.bin\Scripts\Launch.cmd" PSScript "%~dp0\..\.bin\Scripts" "check_disk_fix.ps1" /admin

View file

@ -6,4 +6,4 @@ for %%f in (%*) do (
)
:Launch
call "%~dp0\..\.bin\Scripts\Launch.cmd" Console "%~dp0\..\.bin\Scripts" "check_disk.cmd" "" /admin
call "%~dp0\..\.bin\Scripts\Launch.cmd" PSScript "%~dp0\..\.bin\Scripts" "check_disk.ps1" /admin