1iJaCk

make_WinLatest_FTL.bat

Apr 16th, 2017
373
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 8.63 KB | None | 0 0
  1. :: By: Jack | Release 05/08/2017 | make_WinLatest_FTL.bat | https://pastebin.com/YyUDP18H | [x] Line 228 - Fixed Logic phale.
  2.  
  3. :: Author HAS NEVER RUN IT, Code is UNTESTED
  4. :: Do not read or even run this script/file,  if you're easily offended
  5.  
  6. :: USE AT YOUR [b]OWN[/b] RISK!!!!!11111ONEONEOne
  7. :: - if you do not know what the script/file commands do, DO NOT RUN SCRIPT/FILE
  8. :: -- This Script CAN/WILL brick (brake) your OS  
  9. ::
  10.  
  11. @echo off
  12.  
  13. :: timeout value before main events
  14. set "_wait_time=5"
  15. set "_http_addr=https://www.microsoft.com/en-ca/software-download/windows10"
  16.  
  17. :::::::::::::::::::::::::::::::::::::::
  18. ::                                   ::
  19. ::          [Mis]-Information        ::
  20. ::                                   ::
  21. :::::::::::::::::::::::::::::::::::::::
  22. (
  23.     echo/        
  24.     echo/  Note: Script Author: JaCk found this note in a text file in his archive, then proceeded to create %~n0
  25.     echo/  Note: Note below is restyled from the orginial, restyling by JaCk.      
  26.     echo/  Note: Note below is slightly reworded from the orginial, rewording by JaCk.      
  27.     echo/        
  28.     echo/  Note: Original Author/Source of the note below is UNKNOWN
  29.     echo/        
  30.     echo/        
  31.     echo/      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  32.     echo/        
  33.     echo/        Example, ISO file from Windows 10 version 1511 will not work in a system running Windows 10 version 1607, and vice versa.
  34.     echo/        
  35.     echo/        If you need a Win 10 version 1607 ISO file, use this Media Creation Tool
  36.     echo/            https://www.microsoft.com/en-ca/software-download/windows10
  37.     echo/        
  38.     echo/        - Click the "Download Tool now" button and Run it.
  39.     echo/        -- Then select Create installation media for another PC
  40.     echo/        -- That will begin downloading the ISO file to your computer.
  41.     echo/        
  42.     echo/        When download is completed, RIGHT click at the ISO ^> click Mount ^> and leave it there.
  43.     echo/        - Then open the elevated command prompt and copy and paste this................
  44.     echo/        
  45.     echo/              Dism /Online /Cleanup-Image /RestoreHealth /Source:esd:H:\sources\install.esd:1 /limitaccess
  46.     echo/        
  47.     echo/        - Note :H is the drive where the iso is mounted. Change it if your driver letter is different.
  48.     echo/        
  49.     echo/        - When it is completed, you should get the report that the operation is successful.
  50.     echo/        
  51.     echo/       Now run the sfc /scannow command again. It should be ok this time.
  52.     echo/        
  53.     echo/            sfc /scannow
  54.     echo/        
  55.     echo/      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  56.     echo/        
  57. )
  58. :::::::::::::::::::::::::::::::::::::::
  59. ::                                   ::
  60. :::::::::::::::::::::::::::::::::::::::
  61.  
  62.  
  63.  
  64. :::::::::::::::::::::::::::::::::::::::
  65. ::                                   ::
  66. ::           Status Check            ::
  67. ::          Decision Block           ::
  68. ::                                   ::
  69. :::::::::::::::::::::::::::::::::::::::
  70.  
  71. :: Set Default and Prompting user input
  72. echo/  INPUT: Open Browser and go to "%_http_addr%" [y/N]
  73. set "_input_user=N"
  74. set /p "_input_user="
  75.  
  76. :: go to the url.... If that's what you're into
  77. if /i not "%_input_user:~0,1%" equ "N" (
  78.     start %_http_addr:"=%
  79. )
  80.  
  81.  
  82. :: Admin Check
  83. set "_console_elevated="
  84. "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" 2>nul 1>nul && set /a "_console_elevated+=1"
  85.  
  86.  
  87. :: If batch file is already elevated (admin) then change phrasing of the prompting
  88. if defined _console_elevated (
  89.     echo/  INPUT: Run Commands now? [Y/n]
  90. ) else (
  91.     echo/  INPUT: Elevate (get admin) and run commands now? [Y/n]
  92. )
  93.  
  94.  
  95. :: Set Default and Prompting user input
  96. set "_input_user=Y"
  97. set /p "_input_user="
  98.  
  99.  
  100. :::: Sorry, It's not me, It's you ::::
  101. :::: "I gotta blame somebody.  Otherwise it's all my fault... F_ck that." - Chloe Price [Game - Life is Strange - Dontnod Entertainment - 2015 - Ep 3] ::::
  102. ::
  103. :: exit script/function if answer is not y including [yes/YES/yep/yikes/yellow/YOLO]
  104. ::
  105. if /i not "%_input_user:~0,1%" equ "Y" (
  106.     goto :eof
  107.     exit /b 0
  108. )
  109.  
  110.  
  111. :: attempting to stop the stupid, not enough time to scrub code for the full ritard (yes, ritard)
  112. if defined _wait_time (
  113.     if not %_wait_time:~-5% leq 9999 set /a "_wait_time=9999"
  114. )
  115.  
  116. :::::::::::::::::::::::::::::::::::::::
  117. ::                                   ::
  118. :::::::::::::::::::::::::::::::::::::::
  119.  
  120.  
  121.  
  122. :::::::::::::::::::::::::::::::::::::::
  123. ::                                   ::
  124. ::           Admin me plox           ::
  125. ::                                   ::
  126. :::::::::::::::::::::::::::::::::::::::
  127.  
  128. :: if needed, Create Script for ascension
  129. if not defined _console_elevated (
  130.     echo Set Admin = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  131.     echo Admin.ShellExecute WScript.Arguments^(0^), "", "", "runas", 1 >> "%temp%\getadmin.vbs"
  132. )
  133.  
  134. :: Ascend or Descend [I see you're building a nest]
  135. ::
  136. if defined _console_elevated (
  137.     echo INFO: Admin Elevated Console [x]
  138. ) else (
  139.     echo INFO: Admin Elevated Console [ ]
  140.  
  141.     if exist "%temp%\getadmin.vbs" (
  142.         echo INFO: Starting Script in Admin Mode.
  143.         call cscript "%temp%\getadmin.vbs" "%~s0" || (
  144.             echo/FATAL: ERROR: Unknown
  145.             echo/FATAL: ERROR: Please restart with admin privledges...
  146.    
  147.             if defined _wait_time timeout /t %_wait_time%
  148.             goto :eof 255
  149.             exit /b 255
  150.         )
  151.     ) else (
  152.         echo/FATAL: ERROR: Unable to find my created elevated catalyst ["%temp%\getadmin.vbs"]
  153.         echo/FATAL: ERROR: Please restart with admin privledges...
  154.    
  155.         if defined _wait_time timeout /t %_wait_time%
  156.         goto :eof 1
  157.         exit /b 1
  158.     )
  159.  
  160.     if defined _wait_time timeout /t %_wait_time%
  161.     goto :eof
  162.     exit /b 0      
  163. )
  164.  
  165.  
  166. :::::::::::::::::::::::::::::::::::::::
  167. ::                                   ::
  168. :::::::::::::::::::::::::::::::::::::::
  169.  
  170.  
  171. :::::::::::::::::::::::::::::::::::::::
  172. ::                                   ::
  173. ::        Var Count Bratchula        ::
  174. ::   Give me your Blood.. or Input   ::
  175. ::                                   ::
  176. :::::::::::::::::::::::::::::::::::::::
  177.  
  178. echo/  INPUT: Enter the [dism] command below or just the location of the esd file in question
  179. echo/    example #1: Dism /Online /Cleanup-Image /RestoreHealth /Source:esd:H:\sources\install.esd:1 /limitaccess
  180. echo/    example #2: H:\sources\install.esd:1
  181. echo/    example #3: H:\sources\install.esd
  182. echo/
  183. echo/      Note: as in example #3, script assumes partition :1 unless provided in the path/command (see example #2 above)
  184. echo/
  185. set "_command_dism="
  186. set /p "_command_dism="
  187. echo/
  188. echo/
  189.  
  190. echo/  INPUT: Enter the [sfc] command or any additions to the default [sfc /scannow]
  191. set "_command_sfc=sfc /scannow"
  192. set /p "_command_sfc="
  193. echo/
  194. echo/
  195.  
  196. if not defined _command_dism (
  197.     rem PEACE, I'm OUT, goodbye cruel, cruel console user
  198.     echo/FATAL: ERROR: dism Command Undefined
  199.     goto :eof 1
  200.     exit /b 1
  201. )
  202.  
  203. :: if it's an addition to the command, append it (checks the first 5 characters)
  204. echo "%_command_dism~0,5%" | findstr /i "dism"  2>nul 1>nul
  205.  
  206. if %errorlevel% neq 0 (
  207.     if exist "%_command_dism%" (
  208.         set "_command_dism=Dism /Online /Cleanup-Image /RestoreHealth /Source:esd:%_command_dism%:1 /limitaccess"
  209.     ) else (
  210.        
  211.         rem Check for partition symbol, if found, assume to make an ass of of u and me
  212.         echo %_command_dism:*:=:% | findstr ":" 2>nul 1>nul && (
  213.             set "_command_dism=Dism /Online /Cleanup-Image /RestoreHealth /Source:esd:%_command_dism% /limitaccess"
  214.         )
  215.  
  216.         rem OH NOES, He's Dead Jim.
  217.         echo %_command_dism:*:=:% | findstr ":" 2>nul 1>nul || (
  218.             echo/ERROR: Script is Unable to locate ESD image
  219.             echo/       Proceeding with input anyway
  220.         )
  221.     )
  222. ) else (
  223.     rem dism found in command line, proceeding to assume to make an ass of of u and me
  224.     rem do nothing, eat nothing, sleep... nothing. Because nothing is not something. There is no spoon.
  225. )
  226.  
  227. :: if it's an addition to the command, append it (checks the first 15 characters)
  228. echo "%_command_sfc~0,15%" | findstr /v /i "sfc"  2>nul 1>nul && set "_command_sfc=sfc /scannow %_command_sfc%"
  229.  
  230. :::::::::::::::::::::::::::::::::::::::
  231. ::                                   ::
  232. :::::::::::::::::::::::::::::::::::::::
  233.  
  234.  
  235.  
  236. :::::::::::::::::::::::::::::::::::::::
  237. ::                                   ::
  238. ::         Running Commands          ::
  239. ::                                   ::
  240. :::::::::::::::::::::::::::::::::::::::
  241.  
  242. :: Run Commands
  243. echo INFO: Command: dism: [%_command_dism%]
  244. echo/
  245. echo INFO: Command: sfc:  [%_command_sfc%]
  246. echo/
  247.  
  248. if defined _wait_time timeout /t %_wait_time%
  249.  
  250. call %_command_dism%
  251. call %_command_sfc%
  252.  
  253. :::::::::::::::::::::::::::::::::::::::
  254. ::               GTFO                ::
  255. :::::::::::::::::::::::::::::::::::::::
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment