finding ip addresses 
Author Message
 finding ip addresses

Hi,
Is there any way you can get vbs to output the pc's ip address to a .txt
file?
Many thanks.
Tom


Mon, 17 Nov 2003 19:17:34 GMT  
 finding ip addresses
Can't you use the basic Severvariable and use the filesystemobject to do so by
writing to it a text file? is that what you are looking for?
Quote:
-----Original Message-----

Hi,
Is there any way you can get vbs to output the pc's ip address to a .txt
file?
Many thanks.
Tom

.



Tue, 18 Nov 2003 03:24:59 GMT  
 finding ip addresses
Not enough info.

Are you looking for a ip from a computer on which you are locally running a
vbs file? or a client computer that is getting an asp from your web server?
or the address of the web server serving an asp?

Help us out here...

Jeremy


Quote:
> Hi,
> Is there any way you can get vbs to output the pc's ip address to a .txt
> file?
> Many thanks.
> Tom



Tue, 18 Nov 2003 08:55:13 GMT  
 finding ip addresses
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



Sat, 22 Nov 2003 17:40:59 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Find IP address for a given Server Name

2. Find IP address of a remote host

3. finding ip address from isdn line

4. find IP address from web site

5. Finding IP addresses for use in Winsock

6. finding IP address in VB4

7. Finding IP Addresses for Dial up connection

8. Finding IP addresses for use in Winsock

9. Find IP Address of local machine?

10. Finding IP address

11. Code to Find IP Address, Subnet and Default Gateway

12. Find out IP address of URL.

 

 
Powered by phpBB® Forum Software