It’s a common complaint of IT chaps supporting performance test teams that their script folders are large (especially if you’ve been running scripts with logging enabled for debugging purposes). Lots of files can be deleted before you save or archive your scripts which saves disk space and generally keeps things tidier.
The batch file (tidyup.cmd) attached to this article can help you to tidy up your LoadRunner script folder. It deletes unwanted log files and output files. The following files are deleted.
All files with .idx extension
All files with .bak extension
The Result1 folder and it’s contents
It is also possible to delete RecordingLog.txt file in the scriptdata folder. If you delete this file, it will not affect the script’s replay. However, you will not be able to see the information about what happened during recording.
|Batch file – tidyup.cmd||Description of action|
|IF EXIST %temp%blankfile.txt del %temp%blankfile.txt /q
IF EXIST %temp%FilesDeleted.txt del %temp%FilesDeleted.txt /q
IF EXIST %temp%FoldersDeleted.txt del %temp%FoldersDeleted.txt /q
IF EXIST %temp%BadParms.txt del %temp%BadParms.txt /q
type nul > %temp%blankfile.txt
del *.idx /s >> %temp%FilesDeleted.txt
for %%d in (h) do (
rd result1 /s /q
findstr /S “:\” *.prm > %temp%BadParms.txt
fc %temp%FilesDeleted.txt %temp%blankfile.txt > nul
fc %temp%FoldersDeleted.txt %temp%blankfile.txt > nul
fc %temp%BadParameters.txt %temp%blankfile.txt > nul
IF EXIST %temp%blankfile.txt del %temp%blankfile.txt /q
|These lines delete any existing files from previous runs of this batch file.These lines create blank files for later file comparisons.
These del functions delete the unwanted LoadRunner files and pipe any output into the %temp%FilesDeleted.txt file.
This “for loop” deletes any sub-folders called result1 and pipes any output into the %temp%FoldersDeleted.txt file.
This deletes the local result1 directory if it exists
This function looks for explicit file paths rather than relative file paths in the .PRM files and writes them to the %temp%BadParameters.txt file.
If FilesDeleted.txt exists, open it in Notepad.exe wo we can see the names of deleted files.
If FoldersDeleted.txt exists, open it in Notepad.exe wo we can see the names of deleted folders.
If BadParameters.txt exists, open it in Notepad.exe wo we can see the names of parameters that don’t use relative file paths (and are less portable).
Finally delete the superfluous temporary files.
This batch file can be run either from within a script folder, or from a top-level folder containing multiple LoadRunner scripts. If run in a top level folder it loops through all sub-folders deleting files and results folders as it goes. In both cases, the list of deleted files and folders is displayed using notepad.exe .
Some of my colleagues prefer to have a copy of the tidyup.cmd batch file in all their script folders and some prefer ro run it from the top level folder. If you want a copy of tidyup.cmd in all your sub-folders the copytidy.cmd file can be used to copy the batch file to multiple sub-folders.
|Batch file – copytidy.cmd||Description of action|
|for %%d in (h) do (
for /f “delims=” %%a in (‘dir /a:D /b’) do (
copy %%a tidyup.cmd
|For each sub folder identified by the dir /a:D /b command.
Copy the tidyup.cmd command into the folder.