Board logo

标题: [系统相关] 请鉴定该批处理文件是否可靠 [打印本页]

作者: rockjean    时间: 2021-6-10 15:02     标题: 请鉴定该批处理文件是否可靠

想下载最新的windows arm64版操作系统,几乎没有可用的链接,听说用UUP可以下载源码,然后转换成iso文件,下面是UUP的批处理代码,不知道有没有问题?
  1. @echo off
  2. rem Generated on 2021-06-10 01:52:46 GMT
  3. :: Proxy configuration
  4. :: If you need to configure a proxy to be able to connect to the internet,
  5. :: then you can do this by configuring the all_proxy environment variable.
  6. :: By default this variable is empty, configuring aria2c to not use any proxy.
  7. ::
  8. :: Usage: set "all_proxy=proxy_address"
  9. :: For example: set "all_proxy=127.0.0.1:8888"
  10. ::
  11. :: More information how to use this can be found at:
  12. :: https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-all-proxy
  13. :: https://aria2.github.io/manual/en/html/aria2c.html#environment
  14. set "all_proxy="
  15. :: End of proxy configuration
  16. cd /d "%~dp0"
  17. if NOT "%cd%"=="%cd: =%" (
  18.     echo Current directory contains spaces in its path.
  19.     echo Please move or rename the directory to one not containing spaces.
  20.     echo.
  21.     pause
  22.     goto :EOF
  23. )
  24. if "[%1]" == "[49127c4b-02dc-482e-ac4f-ec4d659b7547]" goto :START_PROCESS
  25. REG QUERY HKU\S-1-5-19\Environment >NUL 2>&1 && goto :START_PROCESS
  26. set command="""%~f0""" 49127c4b-02dc-482e-ac4f-ec4d659b7547
  27. SETLOCAL ENABLEDELAYEDEXPANSION
  28. set "command=!command:'=''!"
  29. powershell -NoProfile Start-Process -FilePath '%COMSPEC%' ^
  30. -ArgumentList '/c """!command!"""' -Verb RunAs 2>NUL
  31. IF %ERRORLEVEL% GTR 0 (
  32.     echo =====================================================
  33.     echo This script needs to be executed as an administrator.
  34.     echo =====================================================
  35.     echo.
  36.     pause
  37. )
  38. SETLOCAL DISABLEDELAYEDEXPANSION
  39. goto :EOF
  40. :START_PROCESS
  41. set "aria2=files\aria2c.exe"
  42. set "a7z=files\7zr.exe"
  43. set "uupConv=files\uup-converter-wimlib.7z"
  44. set "aria2Script=files\aria2_script.%random%.txt"
  45. set "destDir=UUPs"
  46. if NOT EXIST %aria2% goto :NO_ARIA2_ERROR
  47. if NOT EXIST %a7z% goto :NO_FILE_ERROR
  48. if NOT EXIST %uupConv% goto :NO_FILE_ERROR
  49. if NOT EXIST ConvertConfig.ini goto :NO_FILE_ERROR
  50. echo Extracting UUP converter...
  51. "%a7z%" -x!ConvertConfig.ini -y x "%uupConv%" >NUL
  52. echo.
  53. echo Retrieving aria2 script...
  54. "%aria2%" --no-conf --log-level=info --log="aria2_download.log" -o"%aria2Script%" --allow-overwrite=true --auto-file-renaming=false "https://uupdump.net/get.php?id=ccf6ea57-061c-4392-b326-6bcfa6c610ff&pack=zh-cn&edition=corecountryspecific;professional&aria2=2"
  55. if %ERRORLEVEL% GTR 0 call :DOWNLOAD_ERROR & exit /b 1
  56. echo.
  57. for /F "tokens=2 delims=:" %%i in ('findstr #UUPDUMP_ERROR: "%aria2Script%"') do set DETECTED_ERROR=%%i
  58. if NOT [%DETECTED_ERROR%] == [] (
  59.     echo Unable to retrieve data from Windows Update servers. Reason: %DETECTED_ERROR%
  60.     echo If this problem persists, most likely the set you are attempting to download was removed from Windows Update servers.
  61.     echo.
  62.     pause
  63.     goto :EOF
  64. )
  65. echo Attempting to download files...
  66. "%aria2%" --no-conf --log-level=info --log="aria2_download.log" -x16 -s16 -j5 -c -R -d"%destDir%" -i"%aria2Script%"
  67. if %ERRORLEVEL% GTR 0 call :DOWNLOAD_ERROR & exit /b 1
  68. if EXIST convert-UUP.cmd goto :START_CONVERT
  69. pause
  70. goto :EOF
  71. :START_CONVERT
  72. call convert-UUP.cmd
  73. goto :EOF
  74. :NO_ARIA2_ERROR
  75. echo We couldn't find %aria2% in current directory.
  76. echo.
  77. echo You can download aria2 from:
  78. echo https://aria2.github.io/
  79. echo.
  80. pause
  81. goto :EOF
  82. :NO_FILE_ERROR
  83. echo We couldn't find one of needed files for this script.
  84. pause
  85. goto :EOF
  86. :DOWNLOAD_ERROR
  87. echo.
  88. echo We have encountered an error while downloading files.
  89. pause
  90. goto :EOF
  91. :EOF
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2