oyegyan
Jul 7th, 2024
255
-1
Never
This is comment for paste Untitled
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2.  
  3.    nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  4.  
  5.    REM --> If error flag set, we do not have admin.
  6.  
  7.    if '%errorlevel%' NEQ '0' (
  8.  
  9.    echo Requesting administrative privileges…
  10.  
  11.    goto UACPrompt
  12.  
  13.    ) else ( goto gotAdmin )
  14.  
  15.    :UACPrompt
  16.  
  17.    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  18.  
  19.    echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
  20.  
  21.    "%temp%\getadmin.vbs"
  22.  
  23.    exit /B
  24.  
  25.    :gotAdmin
  26.  
  27.    if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
  28.  
  29.    pushd "%CD%"
  30.  
  31.    CD /D "%~dp0" 
  32.  
  33.  pushd "%~dp0"
  34.  
  35.  dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3.mum >List.txt dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3.mum >>List.txt
  36.  
  37.  for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
  38.  
  39. can someone analyse this too as it was claimed that this will do the same but it opened cmd popup with infinte loop
  40.  
Advertisement
Add Comment
Please, Sign In to add comment