原帖由 sgaizxt001 于 2010-2-22 05:04 发表
@echo off
setlocal enabledelayedexpansion
for /f "tokens=1,2 delims==" %%i in (definfo.dat) do (
if /i "%%i"=="curdefs" set str=%%j
)
xco ...
谢谢!
经测试可行,还差不能自动调用 call "%CommonProgramFiles%\Symantec Shared\VirusDefs\back.cmd" 不知那里漏什么了
delims==" %%i "%%i"=="curdefs" set str=%%j 写入back.cmd后缺一个%,%%i改成%%%i后,无法成功写入back.cmd
- @echo off
- echo @echo off>"%CommonProgramFiles%\Symantec Shared\VirusDefs\back.cmd"
- echo setlocal enabledelayedexpansion>>"%CommonProgramFiles%\Symantec Shared\VirusDefs\back.cmd"
- echo for /f "tokens=1,2 delims==" %%i in (definfo.dat) do (>>"%CommonProgramFiles%\Symantec Shared\VirusDefs\back.cmd"
- echo if /i "%%i"=="curdefs" set str=%%j>>"%CommonProgramFiles%\Symantec Shared\VirusDefs\back.cmd"
- echo )>>"%CommonProgramFiles%\Symantec Shared\VirusDefs\back.cmd"
- echo xcopy /e /y "%%~dp0%%str%%" "E:\NETT_Slof\Symantec Antivirus企业版9.0\VirusDefs\%%str%%">>"%CommonProgramFiles%\Symantec Shared\VirusDefs\back.cmd"
- call "%CommonProgramFiles%\Symantec Shared\VirusDefs\back.cmd"
复制代码
[ 本帖最后由 temp 于 2010-2-23 20:57 编辑 ] |