Regex 使用wget或curl更改文件名
首先请原谅我的英语不好,我会尽量让别人理解的 我正在使用批处理文件(Windows,cmd.exe)在我的计算机上检索并静默安装Adobe Flash。 批处理工作得很好,但当Adobe服务器上出现重大版本更改时,我遇到了一个问题。 以下是命令行批处理:Regex 使用wget或curl更改文件名,regex,flash,cmd,filenames,wget,Regex,Flash,Cmd,Filenames,Wget,首先请原谅我的英语不好,我会尽量让别人理解的 我正在使用批处理文件(Windows,cmd.exe)在我的计算机上检索并静默安装Adobe Flash。 批处理工作得很好,但当Adobe服务器上出现重大版本更改时,我遇到了一个问题。 以下是命令行批处理: @echo off setlocal enableextensions md c:\temp\flash pushd c:\temp\flash wget -nH --cut-dirs=5 -r --timestamping http://
@echo off
setlocal enableextensions
md c:\temp\flash
pushd c:\temp\flash
wget -nH --cut-dirs=5 -r --timestamping http://download.macromedia.com/get/flashplayer/current/licensing/win/install_flash_player_15_plugin.exe
wget -nH --cut-dirs=5 -r --timestamping http://download.macromedia.com/get/flashplayer/current/licensing/win/install_flash_player_15_active_x.exe
echo Closing browsers
pause
taskkill /f -im firefox.exe -im iexplore.exe
install_flash_player_15_plugin.exe -install -au 2
install_flash_player_15_active_x.exe -install -au 2
popd
setlocal disableextensions
pause
当Flash升级到下一版本时,文件名将从install\u Flash\u player\u 15\u active\u x.exe更改为
到
install\u flash\u player\u 16\u active\u x.exe
必须手动更正该批次,否则它会被旧版本卡住
有没有办法用通配符或正则表达式替换版本号,以便wget在文件名更改时检索最新文件?
或者至少,是否有任何与Windows兼容的命令行工具可以解析服务器上的文件名,查找最新的文件名并将其作为wget(或cURL)的变量传递
谢谢你你不需要正则表达式就可以获得IE和Firefox当前版本的flash。只需将URL更改为
对于Firefox:
对于IE:
wget -nH --cut-dirs=5 -r --timestamping http://download.macromedia.com/pub/flashplayer/current/support/install_flash_player.exe
wget -nH --cut-dirs=5 -r --timestamping http://download.macromedia.com/pub/flashplayer/current/support/install_flash_player_ax.exe