-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathreset-oldwin-patch.cmd
More file actions
42 lines (35 loc) · 1.69 KB
/
reset-oldwin-patch.cmd
File metadata and controls
42 lines (35 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off & cd /d "%~dp0"
REM :::::::::::::::::::::::::::::::::::::::::
REM Elevate.cmd - Freedom edition
REM Automatically check & get admin rights
REM See "https://stackoverflow.com/a/79585058" for description
REM :::::::::::::::::::::::::::::::::::::::::
ECHO/
ECHO =============================
ECHO Running Admin shell
ECHO =============================
ECHO/
for %%k in (%0) do set batchName=%%~nk
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
:checkPrivileges
%SystemRoot%\System32\whoami.exe /groups /nh | %SystemRoot%\System32\find.exe "S-1-16-12288" >nul
if errorlevel 1 goto getPrivileges
%SystemRoot%\System32\net.exe session >nul 2>&1
if not errorlevel 1 goto gotPrivileges
:getPrivileges
ECHO **************************************
ECHO Invoking UAC for Privilege Escalation
ECHO **************************************
%SystemRoot%\System32\cmd.exe /u /c ECHO CreateObject("Shell.Application").ShellExecute "%SystemRoot%\System32\cmd.exe", "/c""%~f0""", "", "runas", 1 >"%vbsGetPrivileges%"
%SystemRoot%\System32\cmd.exe /u /c ECHO CreateObject("Scripting.FileSystemObject").DeleteFile "%vbsGetPrivileges%">>"%vbsGetPrivileges%"
"%SystemRoot%\System32\WScript.exe" "%vbsGetPrivileges%"
exit /B
:gotPrivileges
REM :::::::::::::::::::::::::
REM START
REM :::::::::::::::::::::::::
REM Run shell as admin - put your code below as you like
del /F /Q "C:\Windows\System32\acryptprimitives.dll"
if exist "C:\Windows\System32\acryptprimitives.dll" (2> nul set =) else (1> nul ver)
if %errorlevel% EQU 0 echo The patch is not present anymore. You can try another Tor redaction if this one was not running, or try this one again.
pause