Link to home
Start Free TrialLog in
Avatar of missing_dll
missing_dllFlag for Netherlands

asked on

netsh interface ip show interface in Windows XP

When I run the following DOS command in Windows XP, I get the following error messages:-

Command:-
netsh interface ip show interface

Error Message:-
The Routing and Remote Access Service is not currently running on the local machine.
Please use 'net start remoteaccess' on the machine to start the service.

However, when I run this in Windows 7, I don't get the error messages, even though the Routing and Remote Access Service in Window 7 is disabled. Enabling the Routing and Remote Access Service works, but I do not want to do this in Windows XP (it is disabled for a reason)
Avatar of oBdA
oBdA

Well, that's just how it is in XP; nothing you can do about, sorry.
What is the information you need; the connection status?
Try
wmic.exe NIC where "NetconnectionID IS NOT NULL" get NetConnectionId,NetConnectionStatus /format:table

Open in new window

If NetConnectionStatus is 2, the NIC is connected.

Win32_NetworkAdapter class (Windows) - MSDN - Microsoft
https://msdn.microsoft.com/.../aa394216(v=vs.85).aspx
Avatar of missing_dll

ASKER

Thanks, however, how would I get this into a FOR /F command ?

Currently using the following in Windows 7:-

For /f "skip=2 tokens=1,2,3,*" %%a In ('NetSh Int Show Int') DO (if %%b==Connected GOTO Up "%%d")
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks!