Hi,
Yes, there was a way to get it. Using the ping command in the vbs script and
writing the answer on txt file.
Try this example:
BEGIN OF SCRIPT*****************************************
'***************************************************************************
***
'* ping was not successful.
'***************************************************************************
***
function IsValidPing(byval vsIpAddress)
dim objFSO, objShell, objTempFile, objTS
dim sCommand, sReadLine
dim bReturn
set objShell = WScript.CreateObject("Wscript.Shell")
set objFSO = CreateObject("Scripting.FileSystemObject")
bReturn = false
sCommand = "cmd /c ping -n 3 -w 1000 "
sCommand = sCommand & vsIpAddress
sCommand = sCommand & " > ""\\uspi\sched\check bridge\temp.txt"""
objShell.run sCommand, 0, true
set objTempFile = objFSO.GetFile("\\uspi\sched\check bridge\temp.txt")
set objTS = objTempFile.OpenAsTextStream(1)
do while objTs.AtEndOfStream <> true
sReadLine = objTs.ReadLine
if instr(lcase(sReadLine), "reply from") > 0 then
bReturn = true
exit do
end if
loop
objTS.close
objTempFile.delete
set objTS = nothing
set objTempFile = nothing
set objShell = nothing
set objFSO = nothing
IsValidPing = bReturn
end function
END OF SCRIPT*****************************************
Bye!
Quote:
> Hi,
> Is there any way you can get vbs to output the pc's ip address to a .txt
> file?
> Many thanks.
> Tom