Listing 3: GetFileVers.bat @Echo Off :: BEGIN COMMENT :: This script expects to find a list of nodes in a file named InputList.txt. This :: text file needs to be in the same path as the script. Configure the path :: to the FileVer tool and the file for which you want to check the version. :: END COMMENT Call :GetFileNames %0 @Title %MyTitle% For /F "usebackq tokens=1" %%i in ("%InList%") Do (Set Node=%%i) & (Call :GetVer) Goto :EOF :GetVer Set FileVer= If not exist "\\%Node%\C$" Echo %Node%, C$ N/A >>"%Log%"& Goto :EOF :: BEGIN CALLOUT A For /F "tokens=*" %%i in ('C:\SupportTools\filever.exe "\\%Node%\C$\WINDOWS\system32\calc.exe" /A') Do Set FileVer=%%i :: END CALLOUT A If Defined FileVer Echo %Node%, %FileVer% >>"%Log%"& Goto :EOF Echo %Node%, N/A>>"%Log%" Goto :EOF :GetFileNames Set MyTitle=%~nx1 Set InList=%~dp1InputList.txt Set Log=%~dpn1-LOG.txt Goto :EOF