Home > Back-end >  About the broken network automatic shutdown
About the broken network automatic shutdown

Time:10-11

Used to hang up at ordinary times, are generally set the shutdown - s - t


But the latest network environment changed, often express broken network


Looked up in the morning, a night of white hang


Want to seek a piece of code, can be broken network automatic shutdown, for help


The following is a VBS limb this code...
This code can realize automatic shutdown function after shutdown time without Internet can automatically set size
I set up 60 seconds here...
Dim the Wsh, objWMIService colMonitoredEvents
Set the Wsh=WScript. CreateObject (" WScript. Shell ")
The Set objWMIService=GetObject (winmgmts: \ \ \ "root \ wmi")
The Set colMonitoredEvents=objWMIService. ExecNotificationQuery (" Select * from MSNdis_StatusMediaDisconnect ")
The Do While True
The Set strLatestEvent=colMonitoredEvents. NextEvent
The Wsh. Run "shutdown - 60 - s - t c" & amp; CRH (34) & amp;" System network disconnection, the machine will close "& amp; CRH (34)
Loop
The above code is saved as a *. VBS format can




The code above, after the execution has been prompt
Line: 1
Character: 1
Error: invalid characters
Code: 800 a0408
Source: Microsoft VBScript compiler error

Why is this?

CodePudding user response:

I don't know about any water posts a great god?

CodePudding user response:

After broken network should be automatic reconnection

CodePudding user response:

What is your networking? Dial-up or routing network
  • Related