求大神解释一个批处理文件
@ECHOOFFECHO...OPERASMTONLINEBACKUP...SETD1=%date:~0,4%SETD2=%date:~5,2%SETD3=%date:~...
@ECHO OFF
ECHO ... OPERA SMT ONLINE BACKUP ...
SET D1=%date:~0,4%
SET D2=%date:~5,2%
SET D3=%date:~8,2%
SET T1=%time:~0,2%
SET T2=%time:~3,2%
SET T3=%time:~6,2%
SET D1=%D1: =0%
SET T1=%T1: =0%
REM change space to Zero
SET DA=%D1%%D2%%D3%
SET TA=%T1%%T2%%T3%
SET SmtCmdPath=D:\MICROS\opera\Tools\OPERA_SMT.exe
IF NOT EXIST %SmtCmdPath% goto :error1
SET BackupRootPath=D:\SmtOnline\
IF NOT EXIST %BackupRootPath% goto :error2
SET BackupParPath=%BackupRootPath%%DA%\
SET BackupSubPath=%BackupParPath%%DA%%TA%\
SET BackupDBName=OperaDB%DA%%TA%.dmp
SET BackupLogName=OperaLog%DA%%TA%.log
SET SmtCmdPara=/k /cmd=export;usr=opera;pwd=opera;odb=opera;sypwd=opera10g;zip=y;
GOTO :RunBackup
:ERROR1
ECHO "%SmtCmdPath%" Not EXIST!!!
PAUSE ERROR1
GOTO :eof
:ERROR2
ECHO "%BackupRootPath%" Not EXIST!!!
PAUSE ERROR2
GOTO :eof
:RunBackup
MD %BackupSubPath%
%SMTCMDPath% %SmtCmdPara%log=%BackupSubPath%%BackupLogName% /i%BackupSubPath%%BackupDBName%
exit 展开
ECHO ... OPERA SMT ONLINE BACKUP ...
SET D1=%date:~0,4%
SET D2=%date:~5,2%
SET D3=%date:~8,2%
SET T1=%time:~0,2%
SET T2=%time:~3,2%
SET T3=%time:~6,2%
SET D1=%D1: =0%
SET T1=%T1: =0%
REM change space to Zero
SET DA=%D1%%D2%%D3%
SET TA=%T1%%T2%%T3%
SET SmtCmdPath=D:\MICROS\opera\Tools\OPERA_SMT.exe
IF NOT EXIST %SmtCmdPath% goto :error1
SET BackupRootPath=D:\SmtOnline\
IF NOT EXIST %BackupRootPath% goto :error2
SET BackupParPath=%BackupRootPath%%DA%\
SET BackupSubPath=%BackupParPath%%DA%%TA%\
SET BackupDBName=OperaDB%DA%%TA%.dmp
SET BackupLogName=OperaLog%DA%%TA%.log
SET SmtCmdPara=/k /cmd=export;usr=opera;pwd=opera;odb=opera;sypwd=opera10g;zip=y;
GOTO :RunBackup
:ERROR1
ECHO "%SmtCmdPath%" Not EXIST!!!
PAUSE ERROR1
GOTO :eof
:ERROR2
ECHO "%BackupRootPath%" Not EXIST!!!
PAUSE ERROR2
GOTO :eof
:RunBackup
MD %BackupSubPath%
%SMTCMDPath% %SmtCmdPara%log=%BackupSubPath%%BackupLogName% /i%BackupSubPath%%BackupDBName%
exit 展开
2个回答
展开全部
这是某应用程序用来备份文件的批处理
该应用程序是“D:\MICROS\opera\Tools\OPERA_SMT.exe”
备份路径是“D:\SmtOnline\”,备份格式是“OperaDB+当前日期+当前时间”
你这个批处理是依赖于具体的应用程序的,所以具体功能我不知道,上边是大概的功能,根据单词“Opera”我判断这个批处理与“Opera浏览器”有关,只能分析这么多了。
哦,差点忘了,“SMT”是这肯定是“系统故障检测”的意思呀。这是检测Opera浏览器的系统故障的批处理呀,如果出问题了,备份重要文件,并写入日志。呵呵,采纳了吧
该应用程序是“D:\MICROS\opera\Tools\OPERA_SMT.exe”
备份路径是“D:\SmtOnline\”,备份格式是“OperaDB+当前日期+当前时间”
你这个批处理是依赖于具体的应用程序的,所以具体功能我不知道,上边是大概的功能,根据单词“Opera”我判断这个批处理与“Opera浏览器”有关,只能分析这么多了。
哦,差点忘了,“SMT”是这肯定是“系统故障检测”的意思呀。这是检测Opera浏览器的系统故障的批处理呀,如果出问题了,备份重要文件,并写入日志。呵呵,采纳了吧
追问
如果要每日都备份的话 是需要怎么修改代码 ?麻烦了
追答
需要这样做吗?如果是Oprera浏览器自己生成的,他自己会调用的,你就不用管了。如果是你从网上下载的,你想每次开机运行,把他拖到“开始菜单”→“所有程序”→“启动”里就行了。(如果你要按天运行,而不是按开机次数运行,把开头第1句和第2句之间加入以下代码后照样拖到“启动”里就行了)
@ECHO OFF
if not exist %windir%\IsRun.log (goto RunNow)
for /f "delims=" %%i in (%windir%\IsRun.log) do (set IsRunToday=%%i)
if "%IsRunToday%"=="%date%" (exit) else (goto RunNow)
:RunNow
echo %date%>%windir%\IsRun.log
ECHO ... OPERA SMT ONLINE BACKUP ...
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询