Upload files to "tacticalrmm"
This commit is contained in:
commit
8b0a026ddb
|
@ -0,0 +1,2 @@
|
|||
@echo off
|
||||
start "" "C:\Program Files\TacticalAgent\unins000.exe" /VERYSILENT
|
|
@ -0,0 +1,64 @@
|
|||
@echo off
|
||||
::::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Elevate.cmd - Version 8
|
||||
:: Automatically check & get admin rights
|
||||
:: see "https://stackoverflow.com/a/12264592/1016343" for description
|
||||
::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
CLS
|
||||
ECHO.
|
||||
|
||||
:init
|
||||
setlocal DisableDelayedExpansion
|
||||
set cmdInvoke=1
|
||||
set winSysFolder=System32
|
||||
set "batchPath=%~dpnx0"
|
||||
rem this works also from cmd shell, other than %~0
|
||||
for %%k in (%0) do set batchName=%%~nk
|
||||
set "vbsGetPrivileges=%temp%\OEgetPriv_%batchName%.vbs"
|
||||
setlocal EnableDelayedExpansion
|
||||
|
||||
:checkPrivileges
|
||||
whoami /groups /nh | find "S-1-16-12288" > nul
|
||||
if '%errorlevel%' == '0' ( goto checkPrivileges2 ) else ( goto getPrivileges )
|
||||
|
||||
|
||||
:checkPrivileges2
|
||||
net session 1>nul 2>NUL
|
||||
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
|
||||
|
||||
:getPrivileges
|
||||
if '%1'=='ELEV' (echo ELEV & shift /1 & goto gotPrivileges)
|
||||
ECHO.
|
||||
ECHO **************************************
|
||||
ECHO Invoking UAC for Privilege Escalation
|
||||
ECHO **************************************
|
||||
|
||||
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%vbsGetPrivileges%"
|
||||
ECHO args = "ELEV " >> "%vbsGetPrivileges%"
|
||||
ECHO For Each strArg in WScript.Arguments >> "%vbsGetPrivileges%"
|
||||
ECHO args = args ^& strArg ^& " " >> "%vbsGetPrivileges%"
|
||||
ECHO Next >> "%vbsGetPrivileges%"
|
||||
|
||||
if '%cmdInvoke%'=='1' goto InvokeCmd
|
||||
|
||||
ECHO UAC.ShellExecute "!batchPath!", args, "", "runas", 1 >> "%vbsGetPrivileges%"
|
||||
goto ExecElevation
|
||||
|
||||
:InvokeCmd
|
||||
ECHO args = "/c """ + "!batchPath!" + """ " + args >> "%vbsGetPrivileges%"
|
||||
ECHO UAC.ShellExecute "%SystemRoot%\%winSysFolder%\cmd.exe", args, "", "runas", 1 >> "%vbsGetPrivileges%"
|
||||
|
||||
:ExecElevation
|
||||
"%SystemRoot%\%winSysFolder%\WScript.exe" "%vbsGetPrivileges%" %*
|
||||
exit /B
|
||||
|
||||
:gotPrivileges
|
||||
setlocal & cd /d %~dp0
|
||||
if '%1'=='ELEV' (del "%vbsGetPrivileges%" 1>nul 2>nul & shift /1)
|
||||
|
||||
:begin
|
||||
echo Killing Tactical RMM and Mesh Agent...
|
||||
net stop "Mesh Agent"
|
||||
net stop "tacticalrmm"
|
||||
timeout /T 5 /NOBREAK > nul
|
Loading…
Reference in New Issue