I have this scrpit below...
but getting error saying
Line 40 Code 800A03EA
and i added in the original script are
Else
if objFSO.FileExists("C:\orant\BIN\GLAHE11I.EXE") then
do while not oFile.atendofstream
strPCNum=oFile.readline
if Ping(strPCNum) = False Then
strOutText = strRemoteFile + vbTab + "Not installed"
oFile2.WriteLine(strOutText)
because i getting error on my orignal script withoout above code when a machine is on and doesnt have the file
================================================
dim objFSO, strFile, strFilePath, OFile, oFile2, strPCNum, strOutputFile, strRemoteFile, strFileVersion, strOutText
Set objFSO = CreateObject("Scripting.FileSystemObject")
set objShell = CreateObject("WScript.Shell")
strFilePath = "C:\orant\BIN\GLAHE11I.EXE"
strInputFile = "C:\Documents and Settings\!cachoe\Desktop\adi\List.csv"
strOutputFile = "C:\Documents and Settings\!cachoe\Desktop\adi\Version.txt"
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) = False Then
strOutText = strRemoteFile + vbTab + "Off LINe"
oFile2.WriteLine(strOutText)
Else
if objFSO.FileExists("C:\orant\BIN\GLAHE11I.EXE") then
do while not oFile.atendofstream
strPCNum=oFile.readline
if Ping(strPCNum) = False Then
strOutText = strRemoteFile + vbTab + "Not installed"
oFile2.WriteLine(strOutText)
Else
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
WScript.Echo "Done"
but getting error saying
Line 40 Code 800A03EA
and i added in the original script are
Else
if objFSO.FileExists("C:\orant\BIN\GLAHE11I.EXE") then
do while not oFile.atendofstream
strPCNum=oFile.readline
if Ping(strPCNum) = False Then
strOutText = strRemoteFile + vbTab + "Not installed"
oFile2.WriteLine(strOutText)
because i getting error on my orignal script withoout above code when a machine is on and doesnt have the file
================================================
dim objFSO, strFile, strFilePath, OFile, oFile2, strPCNum, strOutputFile, strRemoteFile, strFileVersion, strOutText
Set objFSO = CreateObject("Scripting.FileSystemObject")
set objShell = CreateObject("WScript.Shell")
strFilePath = "C:\orant\BIN\GLAHE11I.EXE"
strInputFile = "C:\Documents and Settings\!cachoe\Desktop\adi\List.csv"
strOutputFile = "C:\Documents and Settings\!cachoe\Desktop\adi\Version.txt"
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) = False Then
strOutText = strRemoteFile + vbTab + "Off LINe"
oFile2.WriteLine(strOutText)
Else
if objFSO.FileExists("C:\orant\BIN\GLAHE11I.EXE") then
do while not oFile.atendofstream
strPCNum=oFile.readline
if Ping(strPCNum) = False Then
strOutText = strRemoteFile + vbTab + "Not installed"
oFile2.WriteLine(strOutText)
Else
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
WScript.Echo "Done"