02-19-2010 10:26 AM
Hi,
The below mentioned Vbscript detects whenever the Ethernet cable plugged out from the machine and displays to the user. I want to implement the same code in LabVIEW, but I don't have idea how to do the same. Do you have any idea?
*********VbScript for Ethernet disconnection detection********************
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\wmi")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("Select * from MSNdis_StatusMediaDisconnect")
Do While True
Set strLatestEvent = colMonitoredEvents.NextEvent
Wscript.Echo "A network connection has been lost:"
WScript.Echo strLatestEvent.InstanceName, Now
Wscript.Echo
Loop
**********************************************
Thanks
Sathiya
03-02-2010 11:56 PM - edited 03-03-2010 12:05 AM
Parse the output string from running the ipconfig /all command with system exec. Look for media state "disconnected".
Also see this thread.
http://forums.ni.com/ni/board/message?board.id=170&message.id=341523&requireLogin=False