CODE: [Copy to clipboard]
@echo off
if exist "C:\Progra~1\WinRAR\Rar.exe" (
set RarPath="C:\Progra~1\WinRAR\Rar.exe"
) else (
if exist "%ProgramFiles%\WinRAR\Rar.exe" set RarPath="%ProgramFiles%\WinRAR\Rar.exe"
)
if not defined RarPath call :Find
%RarPath% X -Y -C- -AD %temp%\123.rar C:\
for %%a in (C:\123\*.txt) do (
for %%b in ("%~dp0\%%~nxa") do (
if %%~za gtr %%~zb (
copy /y "%%a" 789>nul
>> update.txt echo %date% %%~nxa 不同,已经复制
if not defined # set #=.
) else (echo %%~nxa 大小相同)
)
)
if defined # (goto copy) else (goto over)
:over
>%temp%\now.vbs echo Msgbox "亲爱的朋友,您目前的程序版本为最新版,目前无可用更新!", 64, "友情提示"
start %temp%\now.vbs & ping -n 2 127.1>nul & goto end
exit /b
:Find
reg export "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" %temp%\_.reg
for /f "skip=4 delims== tokens=2" %%a in ('type %temp%\_.reg') do (
set RarPath=%%~a
call set RarPath="%%RarPath:\\=\%%\Rar.exe"
)
del %temp%\_.reg
[