Support Statement: Cleanup VB6 Source Directory
Overview
On occasion you will have a source tree with files that are not important to the upgrade effort. One way to clean this up is to create a new source tree having only the files that are important. gmStudio can help you do this by creating the list of code files referenced by the VBPs that are part of your upgrade project. This list is produced using the Source Structure Report and the Search Reporting feature to build a windows batch script that you may run to do the copy. The steps to do this are described below.
1) Create a gmStudio project containing the VBPs that are important to your project. The code files referenced by these VBPs will be the ones that end up in the cleaned folder.
2) Search the "Source Structure Report" to create a full list referenced by the VBPs
3) Report the file paths from the search results using the Search Report template:
call :copysrc "%ModFile%"
The results panel will look something like this
call :copysrc "C:\gmClients\ABC\src\Dlls\WFCore\frmError.frm" call :copysrc "C:\gmClients\ABC\src\Dlls\AppMgrs\frmStatus.frm" ... call :copysrc "C:\gmClients\ABC\src\Dlls\HttpRequestDLL\HttpRequestPay.vbp" call :copysrc "C:\gmClients\ABC\src\Screens\Corporation\Corp.vbp"
Now copy and past the search report results into a batch file named copysrc.cmd. This Windows console script uses batch commands and the robocopy utility to copy just the desired files from folder ...\ABC\.. to folder ...\clean\.... Note a .* copy is used to get both frm and frx files.
if exist copysrc.log del copysrc.log call :copysrc "C:\gmClients\ABC\src\Dlls\WFCore\frmError.frm" call :copysrc "C:\gmClients\ABC\src\Dlls\AppMgrs\frmStatus.frm" ... call :copysrc "C:\gmClients\ABC\src\Dlls\HttpRequestDLL\HttpRequestPay.vbp" call :copysrc "C:\gmClients\ABC\src\Screens\Corporation\Corp.vbp" exit /b ::------------------------------------------------------- :copy1src ::------------------------------------------------------- @echo off ::echo full path : %~f1 ::echo drive : %~d1 ::echo path : %~p1 ::echo file name only : %~n1 ::echo extension only : %~x1 ::echo expanded path with short names: %~s1 ::echo attributes : %~a1 ::echo date and time : %~t1 ::echo size : %~z1 ::echo drive + path : %~dp1 ::echo name.ext : %~nx1 ::echo full path + short name : %~fs1 set src=%~p1 set dst=%src:ABC=clean% set srcfldr=%src:~0,-1% set dstfldr=%dst:~0,-1% set filnam=%~n1 echo robocopy "%srcfldr%" "%dstfldr%" "%filnam%.*" robocopy "%srcfldr%" "%dstfldr%" "%filnam%.*">>copysrc.log exit /b :end
4) run the script to copy the desired source files from the source to destination.