Batch file to tidy up contents of LoadRunner script folder

After you finish using LoadRunner scripts, lots of files can be left behind in the script folder, these include output files, error logs and the compiled script. Provided that you know your script works, they can be removed before you archive your scripts to save space on your file server.

 

I use this batch file to tidy up the files that I don’t need.

Paste the text below into a notepad.exe or a similar text editor and save it as a file called “tidyup.bat“.
Copy tidyup.bat into the script folder and run it to tidy up the files in that folder. The script uses the /s switch which means that this script recurses through all sub directories and tidies up files in script sub-folders.

 

After deleting files, it opens notepad.exe and displays the list of deleted files.


@echo off

REM simple menu system

CLS


;START

cls

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.

echo.

echo It will then output a list of what it deleted to: –

echo [c:FilesDeleted.txt]

echo.


if exist c:FilesDeleted.txt del c:FilesDeleted.txt


del *.idx /s >c:FilesDeleted.txt

del mdrv*.log /s >>c:FilesDeleted.txt

del mdrv.txt /s >>c:FilesDeleted.txt

del options.txt /s >>c:FilesDeleted.txt

del *.ci /s >>c:FilesDeleted.txt

del combined_*.c /s >>c:FilesDeleted.txt

del output.txt /s >>c:FilesDeleted.txt

del debug.inf /s >>c:FilesDeleted.txt

del *.bak /s >>c:FilesDeleted.txt


“Notepad.exe” “c:FilesDeleted.txt”

del c:FilesDeleted.txt

 

Author: Richard Bishop

http://about.me/richard_bishop