# ScanTool Help File

## Purpose

ScanTool is a utility for reporting on the files in a directory tree. The program has a number of special features for reporting on Visual Basic Projects (VBPs) and COM binaries. You may find this utility helpful in performing a gross analysis of your VB application portfolio.

## Reporting Parameters

Search Root | the path to the root of the directory tree where the code is stored
Folder Filter | A comma delimited list of simple regular expressions indicating which folders to include in the report. example: */code/*,*/src/* = inspect only subdirectories named “code” or “src”
File Filter | A comma delimited list of simple regular expressions indicating which files to include in the report. example: *.frm,*.cls,*.bas,* only include files with names ending in frm, cls, or bas.
Content Filter (Ignore Case) | A regular expression that is compared with each line of each file reported in DirList mode. The line numbers and text of matching lines will be reported. The Ignore case checkbox makes the expression used with Content Filter case insensitive
Save To | the name of the file to store the report (tab delimited file),
Reporting Mode |
DirList | Report PATH, FILE,EXT, SIZE, and CREATED date of every file in the search tree. If a context filter is specified, the line numbers and text of matching lines will be reported.
FolderCnt | Report PATH, #SUBFOLDERS, #FILES, and SIZE of each folder included in the search.
VBPMod | For VB projects. Report VBPPATH, VBPNAME, NAME, and TYPE or each source file (form, class, module, etc) referenced by the project.
VBPBin | For VB projects. Report the type of binary produced by the project. For each VBP the following columns are reported: VBPPATH, VBPNAME, EXETYPE, EXENAME, MAJVERS, and MINVERS.
VBPRef | For VB projects. Report information on the COM components referenced by the project. For each reference the following columns are reported. VBPPATH, VBPNAME, LIBNAME, LIBGUID, MAJVERS, MINVERS, and LIBPATH.
VBPCount | For VB projects. Report counts of different types of lines in the project. Report includes the following columns: VBPPATH, VBPNAME, MODNAME, MODTIME, MODTYPE, #COD (code), #GUI (UI declarations), #REF (COM references) , #CMN (comments), #BLN (blanks).
VBPSource | For VB projects. Report the VBPPATH, VBPNAME, MODNAME, MODTIME, MODTYPE, LINENUM, LINETYPE (UI, Code, Comments, Blanks), LINETEXT
COMGuid | For COM binaries. Report COMPATH, COMNAME, LIBGUID, LIBNAME.

## Configuration Files

ScanTool allows you to load and save your reporting parameters to XML files. The File/Open and File/SaveAs menu options facilitate this.

## Batch Operation

ScanTool can be operated in batch. If you start the program with a command line it will run in batch mode and the user interface form will not be displayed. The following command line arguments are recognized:

/log=log_file | where log_file names the location of a file to store the batch run log. Note this is a operational log file, not the report file.
/Root=root_path | where root_path names the root directory of the search tree
/OptRpt=rpt_mode | where rpt_mode specifies the reporting mode. The different values of rpt_mode are explained in the table below:
mode | folder filter | file filter | report file
DirList | * | * | DirList.csv
FolderCnt | * | * | FolderCnt.csv
VBPMod | * | *.vbp | VBPMod.csv
VBPBin | * | *.vbp | VBPBinv
VBPRef | * | *.vbp | VBPRef.csv
VBPCount | * | *.vbp | VBPCount.csv
VBPSource | * | *.vbp | VBPSource.csv
COMGuid | * | *.ocx,*.exe,*.dll,*.olb,*.tlb | COMGuid.csv
/Config=cfg_file | where cfg_file names a previously saved ScanTool configuration file.

The script below illustrates batch operation of scan tool:

set rootpath=C:\SourceCode\

::-----------------------------------------------

:: setup and run VB jobs

::-----------------------------------------------

set log=ScanToolVB.log

set ScanToolPath=C:\promulaVB7\vb6\ScanTool\Scantool.exe

echo ===================== VB test ==================== >%log%

echo %ScantoolPath% >> %log%

dir %ScantoolPath% >> %log%

%ScanToolPath% /Config=VBCount.Scantool.xml /Log=%log%

type VBCount.csv >> %log%

%ScanToolPath% /optRpt=COMGuid /Root=%rootpath% /Log=%log%

type COMGuid.csv >> %log%

%ScanToolPath% /optRpt=VBPRef /Root=%rootpath% /Log=%log%

type VBPRef.csv >> %log%

%ScanToolPath% /optRpt=VBPBin /Root=%rootpath% /Log=%log%

type VBPBin.csv >> %log%

%ScanToolPath% /optRpt=VBPMod /Root=%rootpath% /Log=%log%

type VBPMod.csv >> %log%

%ScanToolPath% /optRpt=VBPCount /Root=%rootpath% /Log=%log%

type VBPCount.csv >> %log%

::%ScanToolPath% /optRpt=VBPSource /Root=%rootpath% /Log=%log%

::type VBPSource.csv >> %log%

%ScanToolPath% /optRpt=FolderCnt /Root=%rootpath% /Log=%log%

type FolderCnt.csv >> %log%