Re: IP ADDRESS



On Jul 24, 10:52 pm, LOIS <cesar_pin...@xxxxxxxxxxx> wrote:
I WORK WITH D3 ON LINUX, I WANT TO GET MY IP ADDRESS DIRECTLY FROM D3.

CAN ANYONE HELP ME ???

THANKS.

We are using AccuTerm so I wrote a VBScript to run the "ipconfig"
command and piped it to a file on the client's C drive.

Dim sDirectory As String
Dim WshShell As Object
Dim sWinDir As String

set WshShell = CreateObject("WScript.Shell")

sWinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
sDirectory = sWinDir

If Right(sDirectory,1) <> "\" Then sDirectory = sDirectory & "\

sDirectory = sDirectory & "System32\"
sDirectory = sDirectory & "ipconfig /all>c:\security.txt"

WshShell.Run("%comspec% /c " & sDirectory,0,True)

Another script is used to make a tab delimited file out of the
output. This is required so FTD works properly in the next step.

Dim oFSO As Object
Dim oFile As Object
Dim sText As String
Dim sOutput As String
Dim iX As Integer
Dim iCnt As Integer

Const forReading = 1, forWriting = 2, forAppending = 8

Set oFSO = CreateObject("Scripting.FileSystemObject")

set oFile = oFSO.OpenTextFile("C:\Security.txt",forReading,True)

sOutput = ""
iCnt = 0
Do Until oFile.AtEndOfStream
iCnt = iCnt + 1
sText = oFile.ReadLine
If sOutput = "" Then
sOutput = "Security" & Chr(9) & sText
Else
sOutput = sOutput & Chr(9) & sText
End If
Loop

oFile.Close

Sleep 2000

set oFile = oFSO.OpenTextFile("C:\Security.txt",forWriting,True)
oFile.WriteLine "*"
oFile.WriteLine sOutput
oFile.Close

Then we use FTD to import the file and parse the results

DATA "R"
DATA "K"
DATA "C:\SECURITY.TXT"
DATA ""
DATA "PORT":PORTNO
EXECUTE "FTD"

This allows us to keep track of the IP Address, MAC Address, and
Gateway of every log on session on the system.

Cliff
.



Relevant Pages

  • Re: [Winsock] Server trunks data
    ... Dim sResult As String ... Dim sOutput As String ... Dim sInput As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Dynamic IF or Select Case
    ... > Dim X As Long ... > Dim AnswersAs String ... For Each vFile In vFiles ... Dim sTmp As String, iCnt As Integer ...
    (microsoft.public.vb.general.discussion)
  • Re: Function to return Character Position of Xth character within a st
    ... Function CountMyChar(strCSV As String, ItemNo As Integer, FrontOrBack As ... Dim OneItem As String ... Dim iPos As Integer, iCnt As Integer ...
    (microsoft.public.excel.programming)
  • [Winsock] Server trunks data
    ... and sending a big text file when a client connects to it. ... Dim sResult As String ... Dim sOutput As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Use of Like to extract data
    ... 2 or 3 digits then the decimal. ... I need to extract the string ... For iCnt = 1 To Len ... Dim sAs String ...
    (microsoft.public.excel.programming)