Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
dim objFSO, strFile, strFilePath, OFile, oFile2, strPCNum, strOutputFile, strRemoteFile, strFileVersion, strOutText
Set objFSO = CreateObject("Scripting.FileSystemObject")
set objShell = CreateObject("WScript.Shell")
strFilePath = InputBox("Enter the file path to the file you wish to get the version of", "Enter the file path")
if strFilePath = "" then
wscript.echo "No file path supplied. Quitting Program"
wscript.quit
end if
strInputFile = InputBox("Enter the file path to the file containing the list of PCs", "Enter the file path")
if strInputFile = "" then
wscript.echo "No file path supplied. Quitting Program"
wscript.quit
end if
strOutputFile = InputBox("Enter the file path to write the results to", "Enter the file path")
if strOutPutFile = "" then
wscript.echo "No file path supplied. Quitting Program"
wscript.quit
end if
if objFSO.FileExists(strInputFile) then
set oFile=objFSO.OpenTextFile(strInputFile,1)
set oFile2=objFSO.OpenTextFile(strOutputFile,8,True)
do while not oFile.atendofstream
strPCNum=oFile.readline
if Ping(strPCNum) then
arrayFile = split(strFilePath, ":")
strRemoteFile = "\\" + strPCNum + "\" + arrayFile(0) + "$" + arrayFile(1)
strFileVersion = objFSO.GetFileVersion(strRemoteFile)
strOutText = strRemoteFile + vbTab + strFileVersion
oFile2.WriteLine(strOutText)
end if
loop
else
wscript.echo "File containing list of PCs does not exist. Quitting Program"
wscript.quit
oFile.close
oFile2.Close
end if
Function Ping(PC)
Set objWshScriptExec = objShell.Exec("ping.exe -n 1 " & PC)
Set objStdOut = objWshScriptExec.StdOut
awake=False
Do Until objStdOut.AtEndOfStream
strLine = objStdOut.ReadLine
awake = awake Or InStr(LCase(strLine), "bytes=") > 0
Loop
Ping = awake
End Function