一开始,红色部分我是用set AutoPath=%cd%,双击可执行,但是将这个批处理脚本放在定时任务中无法执行,后来发现在定时执行的时候,当前工作路径不是批处理脚本所在的路径,而是C:/Windows/System32,所以需要用以下方法改变一下当前工作路径。

@echo off
color 0a

echo autotest beginning,Please Wait... ...

set AutoPath=%~dp0
%AutoPath:~0,2% 
pushd %AutoPath%

cd /d %AutoPath%
set JmeterPath=..\..\..\
echo AutoPath=%AutoPath%
echo JmeterPath=%JmeterPath%

forfiles /p %AutoPath%Result /m *.jtl -d -7 /c "cmd /c del /f @path">nul 2>nul
forfiles /p %JmeterPath%extras /m *.html -d -7 /c "cmd /c del /f @path">nul 2>nul

ant -f CIMSmokeTest.xml>%AutoPath%\Result\log.txt

pause

相关文章:

  • 2021-12-23
  • 2022-12-23
  • 2021-05-23
  • 2021-09-20
  • 2021-12-21
  • 2022-01-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2022-02-24
  • 2021-05-06
  • 2022-02-03
  • 2021-07-07
相关资源
相似解决方案