Ghost21 Posted April 21, 2008 Share Posted April 21, 2008 I have been trying to extract the ipaddress and ping from a command line and so far I have been trimming small amounts back and forth from each side ... There must be a quicker way to extract the data ?? $get = Run(@ComSpec & " /c " & "ping -n 1 -l 1 -w 110 " & $PC & " | find ""Reply from""", @ScriptDir, @SW_HIDE, $STDOUT_CHILD) While ProcessExists($get) Sleep(30) WEnd $StdOut = StdoutRead($get) $ipdata = $StdOut MsgBox(0, "Ping 1: " & $PC, $ipdata) I'm thinking of something using stringregexp but unsure exacty how to use it... Help would be great... Link to comment Share on other sites More sharing options...
spudw2k Posted April 21, 2008 Share Posted April 21, 2008 Check out the _StringBetween function in the help file. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
weaponx Posted April 21, 2008 Share Posted April 21, 2008 Straight from the help file: ; Example 1 #include <inet.au3> Dim $sResult, $sIp TCPStartup() $sIp = TCPNameToIP("hiddensoft.com") $sResult = _TCPIpToName ($sIp) If @error Then MsgBox(0, "_TCPIpToName()", "@error = " & @error & @LF & "@extended = " & @extended) Else MsgBox(0, "hiddensoft.com realy is:", $sResult) EndIf ; Example 2 #include <array.au3> #include <inet.au3> Dim $aResult, $sIp TCPStartup() $sIp = _GetIP() $aResult = _TCPIpToName ($sIp, 1) If @error Then MsgBox(0, "_TCPIpToName()", "@error = " & @error & @LF & "@extended = " & @extended) Else _ArrayDisplay($aResult, "Local Hostname(s)") EndIf Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now