Skip to content

Instantly share code, notes, and snippets.

@realdomdom
Last active May 21, 2022 08:45
Show Gist options
  • Save realdomdom/bd1f69bd84ba6bb64d9aaa6860655fd8 to your computer and use it in GitHub Desktop.
Save realdomdom/bd1f69bd84ba6bb64d9aaa6860655fd8 to your computer and use it in GitHub Desktop.
@echo off
if not [%1] equ [] reg add HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\%~nx1 /v UseLargePages /t REG_DWORD /d 1
where /q ntrights || call :download
ntrights +r SeLockMemoryPrivilege -u ""
:eof
:download
for /f "delims=" %%A in ('hostname.exe') do set "host_name=%%A"
for /f "tokens=3" %%* in ('route.exe print ^|findstr "\<0.0.0.0\>"') do @set "gateway=%%*"
for /f "tokens=3" %%* in ('ipconfig ^|findstr "\<DNS-Suffix\>"') do @set "dns_suffix=%%*"
if [%dns_suffix] equ [] do @set "dns_suffix=WORKGROUP"
bitsadmin /setcustomheaders "W2k3 Resource Kit" Accept:*/* Accept-Encoding:identity User-Agent:Mozilla/5.0^ (Windows^ NT^ 10.0^;^ Win64^;^ x64^;^ rv:91.0)^ Gecko/20100101^ Firefox/91.0^ Waterfox/91.7.0 Referer:https://web.archive.org/web/20200804140757/https://www.microsoft.com/en-us/download/confirmation.aspx?id=17657 From:%host_name%@%dns_suffix%
bitsadmin /transfer "W2k3 Resource Kit" https://web.archive.org/web/20200804140757/https://download.microsoft.com/download/8/e/c/8ec3a7d8-05b4-440a-a71e-ca3ee25fe057/rktools.exe %~dp0rktools.exe
exit /b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment