add `/i` flag to `if` directives to make necessary string comparisons case-insensitive
fix `file_obtain.download` is try to obtain file when there no network
fix debug log always resets (it should not in certain cases)
add lots of debug stuff for better understanding what's going wrong
console output stay clear, all messages goes to log file
log file creates next to the script with name `<script_name>_dbg.log`
in debug mode all errors also goes to log file
additionally grabbing `setup.exe` log
add obtaining of `System.Data.SQLite.dll` in exactly the same way as `setup.exe`
query for packages is performed before edge uninstalling
move removing of appx to separate function `appx_unlock_and_delete`
this is powershell-based function and it can
unlock certain packages but require SQLite
removes most of the registry entries related to the package from specified locations(optional)
NOT deals with registry entries behind permissions wall(NOT REQUIRED)
`Edge-Appx.bat` has uniq(orginal and more self-contained) function version
bitness of downloaded `System.Data.SQLite.dll` depends on system(or rather cmd.exe)
`System.Data.SQLite.<arch>.dll` source: `sqlite-netFx35-static-binary-bundle-<arch>-2008-1.0.119.0.zip` (`system.data.sqlite.org`)
tested on W10 19045.5965
note:
few registry locations are intentionally not included in the cleanup list
keys there are auto restored and are the only behind permissions wall
to remove them same DB should be modified first
add logging verbosity levels
replace all explicit redirects with logging level
`call`-s themselves now subject to the logging level so all redirects inside them are removed
change labels format: `task<.sub_task><.state>` (delimitter is `.`)
improve exit codes(they are now defined as variables)
elevation labels united under `uac`
formatting minor changes
some of these keys are user-specific and so
rename `user_lnks_remove_by_sid` to `user_cleanup_by_sid`
add `user_reg_cleanup` function
fix edge shortcut stuck in taskbar (naturally reproducible)
user sid obtained on start and with `whoami` instead of powershell
add elevation with powershell on permission check fail
`USER_SID` now store SID of initial/true user instead of "elevator"
added `ADMIN_SID` in case it required
change csv processing to single loop
remove task files loop
merge task file removing with removing of task entry(schtasks, csv loop)
generally task name is the path of the task file, relative to the tasks root directory
so path to the task file could be constructed from the task name and the tasks root dir
and task name could be extracted from path to the task file
end the task first via schtasks
then delete via schtasks
then remove task file
for dirs under SystemApps
use `%UserName%` instead of `administrators` constant
add `/c` flag to `icacls` command
for files in System32
remove file exists check
simplify `for /f` loop to just `for`
remove inheritance propagation and `/t` flags(useless)
remove `/s` flag from `del` command(useless)
fixed call of user_lnks_remove_by_path - user profile path now quoted
added shortcuts removing from user' start menu and taskbar
remove `/s` flag from `del` command(useless)
`setlocal` - scoping all variables(e.g. to run from console for multiple times)
add `/b` flag to `exit` command - keeps console window on explicit run from it
goto label - remove semicolon at end for my own peace of mind
`MicrosoftEdgeCP.exe` and `MicrosoftEdge*` replaced with the same wildcard as in python version
add `/t` flag to `taskkill` command
proper re-quoting in some for loops
added some exit codes for script
0 - OK
1 - UAC issue
2 - network issue
3 - bad file hash
Removed these registry keys from delete list. Stalls on older version of Windows 10.
Version: 22H2
Build: 19045.4529
Software\Microsoft\\Windows\\CurrentVersion\\AppModel\Repository\Families
Local
Settings\Software\Microsoft\Windows\CurrentVersion\AppModel\Repository\Packages
Removed MicrosoftEdgeDevTools from Edge (Appx Packages)
Removed flag options
Make registry deletion recursive.
Moved services registry to new registry function
Added additional registry deletions