|
想了老半天,折腾了个出来。
别笑话,欢迎修正
- @echo off
- @for /f "tokens=2*" %%i in ('reg query "HKCU\Software\microsoft\wab\wab4\wab file name" /v "" ^| findstr /i /c:"REG_SZ"') do ( set wab=%%j)
- set mydate=%Date:~0,14%%time:~0,2%%time:~3,2%%time:~6,2%
- @if exist "%USERPROFILE%\Application Data\Microsoft\Address Book\%USERNAME%.wab" goto Ori
- @if exist "%wab%" goto Cus
- @goto error
- :Ori
- @msg %username% /time 5 "检测到地址簿:"%USERPROFILE%\Application Data\Microsoft\Address Book\%USERNAME%.wab"!即将更新..."
- @copy /y "%USERPROFILE%\Application Data\Microsoft\Address Book\%USERNAME%.wab" "%systemdrive%\%mydate%.wab" >nul
- @copy /y "Update.wab" "%USERPROFILE%\Application Data\Microsoft\Address Book\%USERNAME%.wab" >nul
- set S=Ori
- goto OK
- :Cus
- @msg %username% /time 5 "检测到地址簿:%wab%!即将更新..."
- @copy /y "%wab%" "%systemdrive%\%mydate%.wab" >nul
- @copy /y "Update.wab" "%wab%" >nul
- set S=Cus
- goto OK
- :OK
- @msg %username% /time 8 "替换成功, 请退出重开 Outlook Express 以生效! %S%"
- exit
- :error
- @msg %username% /time 10 "程序未检测到 Outlook Express 地址簿,更新无法继续!"
- exit
复制代码 |
|