Hi All,
I would like to be able to specify a file path and for Host Monitor to return the version contained within the exe file.
I have been told this is possible, and have had a little help with this, but I am not too familiar with scripting or programming, but really need to get this working.
Any help would be wonderful.
Regards
Nathan
Executable Version Checking
You may use Shell Script test method and script like the following
There are 2 parameters for this script
1) <full path to file>
2) 2nd parameter is optional: <expected file version>
More information regarding Shell Script test method available in the manual, help system and on-line at:
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Regards
Alex
Code: Select all
Option Explicit
const statusAlive = "scriptRes:Host is alive:"
const statusDead = "scriptRes:No answer:"
const statusUnknown = "scriptRes:Unknown:"
const statusNotResolved = "scriptRes:Unknown host:"
const statusOk = "scriptRes:Ok:"
const statusBad = "scriptRes:Bad:"
const statusBadContents = "scriptRes:Bad contents:"
dim objFSO, objArgs, filever
Set objArgs = WScript.Arguments
if objArgs.Count<1 then
WScript.StdOut.Write statusUnknown & "Parameter requited: <Full_path_to_the_file>"
WScript.Quit
end if
Set objFSO = CreateObject("Scripting.FileSystemObject")
if objFSO.FileExists(objArgs(0)) then
filever = objFSO.GetFileVersion(objArgs(0))
if objArgs.Count>1 then
if filever = objArgs(1) then
WScript.StdOut.Write statusOk & filever
else
WScript.StdOut.Write statusBad & filever
end if
else
WScript.StdOut.Write statusOk & filever
end if
else
WScript.StdOut.Write statusUnknown & "File [" & objArgs(0) & "] does not exist."
end if
1) <full path to file>
2) 2nd parameter is optional: <expected file version>
More information regarding Shell Script test method available in the manual, help system and on-line at:
http://www.ks-soft.net/hostmon.eng/mfra ... m#chkShell
Regards
Alex
Well, you don't need to know much about scripts because we created script for you.
You just need to setup Shell Script test item. How to do this described in the manual (manual in MS Word format included in the package, check manual.doc file located in HostMonitor folder).
Also you may read necessary information on-line, just click on link I provided in my previous answer.
Regards
Alex
You just need to setup Shell Script test item. How to do this described in the manual (manual in MS Word format included in the package, check manual.doc file located in HostMonitor folder).
Also you may read necessary information on-line, just click on link I provided in my previous answer.
When you setup Shell Script test item it allows you to select script and specify parameters.Where should I specify the path to the file name?
Regards
Alex
Alex,
I have worked out that on the test setup page, I can specify the params.... but I really have no idea what to put in this box. I have tried the path to my file "C:\IPS.exe" and it either returns a result of "script returned no results" or "file not found" depending on how I input this.
Help with what to put in this box would be great
I have worked out that on the test setup page, I can specify the params.... but I really have no idea what to put in this box. I have tried the path to my file "C:\IPS.exe" and it either returns a result of "script returned no results" or "file not found" depending on how I input this.
Help with what to put in this box would be great

Are you sure you have selected correct script for this test?
Have you read the manual that tells you how to work with Script Manager?
What Windows do you use? Service Pack?
HostMonitor version?
Script may receive one or two parameters
For example:
"c:\ips.exe" "6.1"
or
"c:\ips.exe"
Note1: If there are space characters in the path (e.g C:\Program Files\test.exe), use quotation marks.
Note2: You may try parameters like "C:\Windows\notepad.exe" "6.1.7600.16385" to be sure script is working.
Regards
Alex
Have you read the manual that tells you how to work with Script Manager?
What Windows do you use? Service Pack?
HostMonitor version?
Script may receive one or two parameters
For example:
"c:\ips.exe" "6.1"
or
"c:\ips.exe"
Note1: If there are space characters in the path (e.g C:\Program Files\test.exe), use quotation marks.
Note2: You may try parameters like "C:\Windows\notepad.exe" "6.1.7600.16385" to be sure script is working.
Regards
Alex