嗨,我是脚本新手,我创建了这个示例脚本来过滤掉日志文件中的所有时间戳,当我在命令提示符中手动使用它时,它对我有效,但在.bat文件中不起作用。
@ECHO OFF
: ************** Report Tracking in FR *************************************************
: ********** to find keywords relevent Timestamps **************************************
: ****************** From the Log files ************************************************
cd F:\oracle\Middleware\user_projects\domains\EPMSystem\servers\FinancialReporting0\logs
(FOR %G IN (*.log) do (find /i "Name:" "%G"))> out.log你知道我可能错过了什么吗?
发布于 2013-12-24 03:35:39
问题:
(FOR %G IN (*.log) do (find /i "Name:" "%G"))> out.log在批处理文件中,你必须将" for -variable:
(FOR %%G IN (*.log) do (find /i "Name:" "%%G"))> out.log此外,如果您尝试更改到另一个驱动器,请使用cd /d
https://stackoverflow.com/questions/20749982
复制相似问题