Advertisement
noviceuser

W7 Security Updates: Download Updates W10+

Jul 9th, 2025 (edited)
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 5.14 KB | None | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3.  
  4. echo Windows Defender Signature Downloader (Windows 10)
  5. echo ==================================================
  6. echo This script downloads signature updates to network share
  7. echo.
  8.  
  9. :: Define network paths
  10. set "SHARE_X86=[ENTER FILE LOCATION]"
  11. set "SHARE_X64=[ENTER FILE LOCATION]"
  12. set "FILE_X86=!SHARE_X86!mpam-fe.exe"
  13. set "FILE_X64=!SHARE_X64!mpam-fe.exe"
  14.  
  15. :: Define download URLs
  16. set "URL_X86=https://go.microsoft.com/fwlink/?LinkID=121721&arch=x86"
  17. set "URL_X64=https://go.microsoft.com/fwlink/?LinkID=121721&arch=x64"
  18.  
  19. echo Network Share Paths:
  20. echo - x86: !SHARE_X86!
  21. echo - x64: !SHARE_X64!
  22. echo.
  23.  
  24. :: Step 1: Check network connectivity
  25. echo Step 1: Checking network connectivity...
  26. if not exist "!SHARE_X86!" (
  27.     echo ERROR: Cannot access x86 network share: !SHARE_X86!
  28.     echo Please check network connectivity and share permissions
  29.     pause
  30.     exit /b 1
  31. )
  32.  
  33. if not exist "!SHARE_X64!" (
  34.     echo ERROR: Cannot access x64 network share: !SHARE_X64!
  35.     echo Please check network connectivity and share permissions
  36.     pause
  37.     exit /b 1
  38. )
  39.  
  40. echo ✓ Network shares accessible
  41. echo.
  42.  
  43. :: Step 2: Delete existing files if they exist
  44. echo Step 2: Checking for existing files...
  45.  
  46. if exist "!FILE_X86!" (
  47.     echo Found existing x86 file: !FILE_X86!
  48.     echo Deleting existing x86 file...
  49.     del "!FILE_X86!"
  50.     if !errorlevel! neq 0 (
  51.         echo ERROR: Failed to delete x86 file
  52.         pause
  53.         exit /b 1
  54.     )
  55.     echo ✓ x86 file deleted successfully
  56. ) else (
  57.     echo ✓ No existing x86 file found
  58. )
  59.  
  60. if exist "!FILE_X64!" (
  61.     echo Found existing x64 file: !FILE_X64!
  62.     echo Deleting existing x64 file...
  63.     del "!FILE_X64!"
  64.     if !errorlevel! neq 0 (
  65.         echo ERROR: Failed to delete x64 file
  66.         pause
  67.         exit /b 1
  68.     )
  69.     echo ✓ x64 file deleted successfully
  70. ) else (
  71.     echo ✓ No existing x64 file found
  72. )
  73.  
  74. echo Step 2 Complete: File cleanup finished
  75. echo.
  76.  
  77. :: Step 3: Download x86 version
  78. echo Step 3: Downloading x86 version...
  79. echo URL: !URL_X86!
  80. echo Destination: !FILE_X86!
  81.  
  82. powershell -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; try { Invoke-WebRequest -Uri '!URL_X86!' -OutFile '!FILE_X86!' -MaximumRedirection 10 -UserAgent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' } catch { Write-Host 'Download failed:' $_.Exception.Message; exit 1 } }"
  83.  
  84. if !errorlevel! neq 0 (
  85.     echo ERROR: x86 download failed
  86.     pause
  87.     exit /b 1
  88. )
  89.  
  90. if not exist "!FILE_X86!" (
  91.     echo ERROR: x86 file not found after download
  92.     pause
  93.     exit /b 1
  94. )
  95.  
  96. :: Check file size
  97. for %%A in ("!FILE_X86!") do set "X86_SIZE=%%~zA"
  98. if !X86_SIZE! LSS 1000 (
  99.     echo WARNING: x86 file seems too small (!X86_SIZE! bytes)
  100.     echo This might indicate a download error
  101. )
  102.  
  103. echo ✓ x86 download completed successfully (Size: !X86_SIZE! bytes)
  104. echo Step 3 Complete: x86 version downloaded
  105. echo.
  106.  
  107. :: Step 4: Download x64 version
  108. echo Step 4: Downloading x64 version...
  109. echo URL: !URL_X64!
  110. echo Destination: !FILE_X64!
  111.  
  112. powershell -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; try { Invoke-WebRequest -Uri '!URL_X64!' -OutFile '!FILE_X64!' -MaximumRedirection 10 -UserAgent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' } catch { Write-Host 'Download failed:' $_.Exception.Message; exit 1 } }"
  113.  
  114. if !errorlevel! neq 0 (
  115.     echo ERROR: x64 download failed
  116.     pause
  117.     exit /b 1
  118. )
  119.  
  120. if not exist "!FILE_X64!" (
  121.     echo ERROR: x64 file not found after download
  122.     pause
  123.     exit /b 1
  124. )
  125.  
  126. :: Check file size
  127. for %%A in ("!FILE_X64!") do set "X64_SIZE=%%~zA"
  128. if !X64_SIZE! LSS 1000 (
  129.     echo WARNING: x64 file seems too small (!X64_SIZE! bytes)
  130.     echo This might indicate a download error
  131. )
  132.  
  133. echo ✓ x64 download completed successfully (Size: !X64_SIZE! bytes)
  134. echo Step 4 Complete: x64 version downloaded
  135. echo.
  136.  
  137. :: Step 5: Final verification
  138. echo Step 5: Final verification...
  139. echo.
  140. echo Download Summary:
  141. echo =================
  142. echo x86 file: !FILE_X86!
  143. echo   Size: !X86_SIZE! bytes
  144. echo   Status:
  145. if exist "!FILE_X86!" (
  146.     echo   ✓ Present
  147. ) else (
  148.     echo   ✗ Missing
  149. )
  150.  
  151. echo.
  152. echo x64 file: !FILE_X64!
  153. echo   Size: !X64_SIZE! bytes
  154. echo   Status:
  155. if exist "!FILE_X64!" (
  156.     echo   ✓ Present
  157. ) else (
  158.     echo   ✗ Missing
  159. )
  160.  
  161. echo.
  162. echo =================
  163. echo Final Status:
  164. if exist "!FILE_X86!" if exist "!FILE_X64!" (
  165.     echo ✓ SUCCESS: Both files downloaded successfully
  166.     echo.
  167.     echo The signature update files are now available on the network share
  168.     echo Windows 7 clients can now run Script 2 to update their signatures
  169.     echo.
  170.     echo Network paths for clients:
  171.     echo - 32-bit systems: !SHARE_X86!mpam-fe.exe
  172.     echo - 64-bit systems: !SHARE_X64!mpam-fe.exe
  173. ) else (
  174.     echo ✗ FAILURE: One or more downloads failed
  175.     echo Please check the error messages above and retry
  176. )
  177.  
  178. echo.
  179. echo Download process completed
  180. echo Current timestamp: %DATE% %TIME%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement