本帖最后由 yakeyun 于 2023-5-27 21:51 编辑
此脚本可以用来获取NVIDIA显卡的历史版本,并记录有效的版本号和对应的下载链接,同时下载文件到本目录。
版本号是利用累加自动生成新版本号,然后利用系统自带的CURL工具下载对应文件,再通过判断下载文件是否大于100M,如果大于100M就判断为有效文件,并记录下版本号和下载链接,如果小于100M就删除下载文件。- ::最新版532.03
- @echo off
- setlocal EnableDelayedExpansion
- title 穷举法NVIDIA历史版本驱动获取...
- mode con cols=80 lines=5
- color 2
- set ver=531
-
- :loop
- cls
- echo 当前获取版本:!ver!
- curl -O https://cn.download.nvidia.cn/Windows/!ver!/!ver!-desktop-win10-win11-64bit-international-dch-whql.exe
- set "NVIDIA=0"
- for %%F in ("!abc!.!de!-desktop-win10-win11-64bit-international-dch-whql.exe") do (
- if %%~zF GTR 104857600 (
- set "NVIDIA=1"
- )
- )
- if %NVIDIA% EQU 1 (
- echo !abc!.!de!:https://cn.download.nvidia.cn/Windows/!ver!/!ver!-desktop-win10-win11-64bit-international-dch-whql.exe >>ValidData.ini
- ) else (
- del /f "!ver!-desktop-win10-win11-64bit-international-dch-whql.exe"
- )
- for /f %%a in ('powershell -command "!ver! + 0.01"') do set "ver=%%a"
- goto :loop
复制代码 最终获取到的有效文件会被保存到当前目录ValidData.ini文件中,其内容如下:- 531.18:https://cn.download.nvidia.cn/Windows/531.18/531.18-desktop-win10-win11-64bit-international-dch-whql.exe
- 531.29:https://cn.download.nvidia.cn/Windows/531.29/531.29-desktop-win10-win11-64bit-international-dch-whql.exe
- 531.41:https://cn.download.nvidia.cn/Windows/531.41/531.41-desktop-win10-win11-64bit-international-dch-whql.exe
- 531.61:https://cn.download.nvidia.cn/Windows/531.61/531.61-desktop-win10-win11-64bit-international-dch-whql.exe
- 531.68:https://cn.download.nvidia.cn/Windows/531.68/531.68-desktop-win10-win11-64bit-international-dch-whql.exe
- 531.79:https://cn.download.nvidia.cn/Windows/531.79/531.79-desktop-win10-win11-64bit-international-dch-whql.exe
- 532.03:https://cn.download.nvidia.cn/Windows/532.03/532.03-desktop-win10-win11-64bit-international-dch-whql.exe
-
复制代码
|