lr脚本中哪些文件可以删除
上一篇 /
下一篇 2012-02-10 11:40:35
/ 个人分类:loadrunner
运行Loadrunner脚本时,会产生与脚本文件名相同的文件夹。当你需要在另一台计算机上运行时,其下的大多数文件是需要的。因此,最简单的做法是把整个文件夹拷过去。如果你想删除一些不必要的文件,你可以删除一些日志和输出文件。 具体包括:
options.txt mdrv_cmd.txt mdrv.log debug.inf pre_cci.c .ci combined_.c output.txt
除了以上,还包括所有扩展名为.idx和.bak的文件以及Result1文件夹下的文件和子目录。 注:如果删除“脚本目录\data文件夹下的RecordingLog.txt”文件,虽然不影响脚本的回放,但是不能 再看到在录制过程中发生的信息。
在Loadrunner脚本目录下哪些文件可以删除呢? 就这个问题而言不是什么问题,因为把整个脚本文件夹移过去,既快又安全。但是,通过了解这些文件,将有助于深入理解Loadrunner工作原理和开发脚本等等。 为了提高效率,现提供一个批处理文件代替手工删除过程。如果大家发现还可以删除其它文件而不影响在另一台计算机上运行,那么可以不断地补充。具体代码如下: echo off cls echo. echo. echo This batch file will delete the following files from every echo folder and subdirectory from the folder in which it is run: echo. echo *.idx echo mdrv*.log echo mdrv.txt echo options.txt echo *.ci echo combined_*.c echo output.txt echo debug.inf echo *.bak echo \result1 echo. echo. if exist %temp%\FilesDeleted.txt del %temp%\FilesDeleted.txt del *.idx /s >%temp%\FilesDeleted.txt del mdrv*.log /s >>%temp%\FilesDeleted.txt del mdrv.txt /s >>%temp%\FilesDeleted.txt del options.txt /s >>%temp%\FilesDeleted.txt del *.ci /s >>%temp%\FilesDeleted.txt del combined_*.c /s >>%temp%\FilesDeleted.txt del output.txt /s >>%temp%\FilesDeleted.txt del debug.inf /s >>%temp%\FilesDeleted.txt del *.bak /s >>%temp%\FilesDeleted.txt rd result1 /s /q "Notepad.exe" "%temp%\FilesDeleted.txt" del %temp%\FilesDeleted.txt 可以把上述代码存成fileDel.bat或fileDel.cmd,都可以,随大家意。 最后,对代码稍作解释一下。 首先,该批处理文件(fileDel.bat)从它所在的目录开始查找上面列出的要删除的文件,在查找之前判断是否存在FileDeleted.txt文件, 存在则删除。 其次,如果找到列出文件时,就把该文件删除,并把删除信息输出到FileDeleted.txt。没有找到时就会有找不到 XXX文件 的提示。 最后,当查找结束后会调用记事本打开FileDeleted.txt文件,删除信息一目了然。 该打住了,不是问题的问题说得太多了。Enjoy! 本文来自: 天天测试社区(http://www.365testing.com/bbs/) 详细文章参考:http://www.365testing.com/bbs/thread-20720-1-1.html |
收藏
举报
TAG: