![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Vista Home Premium 32bit | Programming in CMD Just to give you guys an idea of what I am trying to do. I want to make some simple programs using Command Prompt in Windows Vista. No, this is not a problem I am having with the OS. What I am trying to do, is to write a simple program that allows me to run IPCONFIG test for whatever computer this program is on. However, I need to know if there is a way to capture the IP address of the computer. So that it can be retrieved by the program and used to ping the local machine of the system? |
My System Specs![]() |
| | #2 (permalink) |
| Vista Ultimate x64 MAK, OpenSolaris 5, Gentoo 2008.1.... | Re: Programming in CMD There are third party apps that can do it, but not a really reliable way (AFAIK) o capture the *external* IP of the system. Then again, I don't do this often, and I may be way off base.... |
My System Specs![]() |
| | #3 (permalink) |
| Mojave Ultimate x64 | Re: Programming in CMD Just to give you guys an idea of what I am trying to do. I want to make some simple programs using Command Prompt in Windows Vista. No, this is not a problem I am having with the OS. What I am trying to do, is to write a simple program that allows me to run IPCONFIG test for whatever computer this program is on. However, I need to know if there is a way to capture the IP address of the computer. Code: strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
n = 1
For Each objAdapter in colAdapters
If Not IsNull(objAdapter.IPAddress) Then
For i = 0 To UBound(objAdapter.IPAddress)
WScript.Echo " Your Local IP address is: " & objAdapter.IPAddress(i)
Next
End If
n = n + 1
Next
Function WMIDateStringToDate(utcDate)
WMIDateStringToDate = CDate(Mid(utcDate, 5, 2) & "/" & _
Mid(utcDate, 7, 2) & "/" & _
Left(utcDate, 4) & " " & _
Mid (utcDate, 9, 2) & ":" & _
Mid(utcDate, 11, 2) & ":" & _
Mid(utcDate, 13, 2))
End Function
Quote: So that it can be retrieved by the program and used to ping the local machine of the system? |
My System Specs![]() |
| | #4 (permalink) |
| Vista Home Premium 32bit | Re: Programming in CMD As for where I lost you. There is a truncated version of the command prompt in Windows Vista. What I am trying to do is simply this. When I start the program it runs the ip configuration test for you. So what you have is this. In the program it has a line of command that brings up your ip configuration information. Then grabs your IP from the local machine, and pings the IP address. So, it would look something lik this. ipconfig /all (program grabs the IP address of the local machine) ping ooo.ooo.oo.o (program has pinged the IP address through the command prompt and pings it.) I hope this makes things a little more clear. If I have lost you then I can attempt to tell you what it is. |
My System Specs![]() |
| | #5 (permalink) |
| Mojave Ultimate x64 | Re: Programming in CMD Ok this is what is confusing me, it sounds like you are running the program on a local machine and then trying to ping its own address. |
My System Specs![]() |
| | #6 (permalink) |
| Vista Home Premium 32bit | Re: Programming in CMD Pretty much. I am trying to write a program that will grab the ip address as a variable, then ping that address automaticly. |
My System Specs![]() |
| | #7 (permalink) |
| Mojave Ultimate x64 | Re: Programming in CMD Well you could edit that script I pasted above, and then take a look here and add this code: http://windowsitpro.com/article/arti...a-machine.html Just mod that code to ping the returned value from the script from my previous post. If you get stuck let me know. Just out of curiousity, why are you trying to ping the local IP address? |
My System Specs![]() |
| | #8 (permalink) |
| Vista Home Premium 32bit | Re: Programming in CMD I am currantly a student at a private IT college. I am trying to do simple programming as it relates to a class I am currantly taking. What I wanted to do was to make a program that runs an IP test to test home network connections, then gives you the simple information that any tech would use to diagnose network issues. Including ping rate, timing issues, DNS resolution issues, and so forth, ect ect. |
My System Specs![]() |
| | #9 (permalink) |
| Vista Ultimate x64 MAK, OpenSolaris 5, Gentoo 2008.1.... | Re: Programming in CMD You might could look into Windows Power Shell - it is much more robust and will probably suit your needs. |
My System Specs![]() |
| | #10 (permalink) |
| Vista Home Premium 32bit | Re: Programming in CMD I will look into that. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| 64 bit programming | General Discussion | |||
| New to programming | .NET General | |||
| c programming on 64bit | Microsoft Office | |||
| Team programming | .NET General | |||
| TV Programming Guide Off | Vista General | |||