2009. 6. 22. 16:28
원격 포트 접속 확인 VBS (Script) Etc.2009. 6. 22. 16:28
strMessage = ""
set shellobj=WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile (".\RUNNETSTAT.BAT", 8, True)
objTextFile.WriteLine("netstat -an | findstr " & Chr(34) & "168.126.63.1:53" & Chr(34) & " | findstr " & Chr(34) & "EST" & Chr(34))
objTextFile.Close
set objTextFile = nothing
set execObj=shellobj.Exec(".\RUNNETSTAT.BAT")
OutData=execObj.StdOut.ReadAll()
val=execObj.StdOut.Line - 3
Set aFile = objFSO.GetFile(".\RUNNETSTAT.BAT")
aFile.Delete
Set aFile = nothing
If val = 0 Then
strMsg = MsgBox("Port Error!!",16,"Caution")
End If
set OutData = nothing
set execObj = nothing
set shellobj = nothing