Advertisement
Guest User

Untitled

a guest
Aug 26th, 2021
281,757
1
Never
4
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 1 0
  1. @echo off
  2. pushd "%~dp0"
  3.  
  4. dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
  5. dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt
  6.  
  7. for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
  8. pause
Advertisement
Comments
  • Mischievous427
    141 days
    # text 0.09 KB | 0 0
    1. Has anyone checked if this code has any malware?
    2. I know it doesn't, but just to be sure.
    • -jorel
      126 days (edited)
      # text 0.31 KB | 1 0
      1. Lines 4 and 5 basically do the same thing - search C:\Windows for the Windows Update Package files and add them to a text list.
      2. Line 7 uses Windows' Deployment Image Servicing and Management tool to retrieve the file names from the list and install them.
      3. This uses Windows' own files and tools, so no malware here.
  • oyegyan
    19 days
    # text 1.13 KB | 0 0
    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.  
Add Comment
Please, Sign In to add comment
Advertisement