Ask Experts Questions for FREE Help !
Ask
    tekamoka's Avatar
    tekamoka Posts: 3, Reputation: 1
    New Member
     
    #1

    Jul 27, 2008, 01:50 AM
    I want to shutdown the PC when no cable is plugged
    Dear
    Please I need help , I am a system administrator in a chemical factory. I want to shutdown any PC on the network when the network cable is unplugged.
    Can any one help me in that topic , thank you in advance for your help
    Kontra's Avatar
    Kontra Posts: 1, Reputation: 1
    New Member
     
    #2

    Jul 27, 2008, 09:56 PM
    Hello tekamoka,

    Hate to break it to you, but without some form of communication between your computer, and the target computer, It's just not possible to shut down a remote computer.

    You could always install a wireless adapter to the target PC, and install a wireless router on the network, and then use DAMEWARE to remotely control/shutdown the target PC, but without the two computer communicating someway, its not possible.

    -Kontra
    tekamoka's Avatar
    tekamoka Posts: 3, Reputation: 1
    New Member
     
    #3

    Jul 27, 2008, 11:54 PM
    Dear Kontra
    I think you do not get my point of course if no connection how can I shutdown remote computer.
    I want to create batch or service or any thing and run it on all the computers of my network so if any one of them unplugged the network cable his computer will be shutdown that is exactly what I need.

    Thank you
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #4

    Jul 28, 2008, 06:56 AM
    The only posibility I can see is periodically ping your server and if the ping fails, then shutdown. Not sure how to do this though.
    chuckhole's Avatar
    chuckhole Posts: 850, Reputation: 45
    Senior Member
     
    #5

    Jul 28, 2008, 08:40 AM
    Attached is the VBScript that will perform what you want. You will need to remove the .txt extension and leave it as a .vbs extension. The script will copy itself to the local machine - Windows folder - and then insert a registry entry into the user profile so that it will autolauch during startup. The script pings a server or other network device by name or IP address and will continue to do so until the host is unreachable. At that point, the computer will reboot. Once the script launches during startup, the process starts all over again.

    To kill the script on a specific machine, go to Task Manager and stop the WSCRIPT.EXE process. To run the initial script on your computers, you can add it to a Group Policy or a logon script. I would highly suggest you learn some VBScript so that you will have an understanding of what the script performs.

    You will have to change a value in the script for the name or IP address of the server/device you wish to check. DO NOT change anything except what is in the quotes. Change server_name to what you want. Excerpt from script:

    ' This script is designed to ping a machine across a network and reboot
    ' the host if the machine no longer responds.

    On Error Resume Next

    Dim strServer ' server name or IP address to check for network connection
    strServer = "server_name"
    Attached Files
  1. File Type: txt BootMonitor.vbs.txt (3.1 KB, 268 views)
  2. ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #6

    Jul 28, 2008, 09:01 AM
    Very nice Chuck, Great job.

    I am curious though as to whether this will cause a performance hit.
    chuckhole's Avatar
    chuckhole Posts: 850, Reputation: 45
    Senior Member
     
    #7

    Jul 28, 2008, 10:09 AM
    Yes it can. You can tune how often it will ping by changing the following line of code:

    Do While MachineStatus(strServer) = TRUE
    WScript.Sleep 10000
    Loop

    Change the sleep time to a higher value. Try 50000 or 100000 instead of 10000. This will increase the time between ping intervals. The device that is being pinged will see the biggest performance hit but ICMP responses are only 32bytes by default.

    Note that the default timeout for an ICMP response is 1000ms. So if your network is performing poorly (and this would be really bad) then it is the same as no response. We get typical roundtrip times of less than 300ms to our locations in the Asia Pacific.
    chuckhole's Avatar
    chuckhole Posts: 850, Reputation: 45
    Senior Member
     
    #8

    Jul 28, 2008, 10:25 AM
    Quote Originally Posted by ScottGem
    Very nice Chuck, Great job.
    Scott,
    Your post is what gave me the idea. I already had the functions in use in other scripts so it was easy just to combine them here and write the additional code to do the job.

    Thank you for the compliment. It rates very high since it comes from somebody that does code.
    tekamoka's Avatar
    tekamoka Posts: 3, Reputation: 1
    New Member
     
    #9

    Jul 29, 2008, 12:25 AM
    OK the idea of pining the server is good but for some reason may be I shutdown the server to fix something in my server or unplug it so in this case, all the computers will be shutdown so my question now:-
    Are there any function in the windows that checks the cable in the computer ?
    Thank you very much for your help.
    Please do not send the file I got it(was a problem in the web browser.

    Wait for precious help :) and thanks again
    chuckhole's Avatar
    chuckhole Posts: 850, Reputation: 45
    Senior Member
     
    #10

    Jul 29, 2008, 10:22 AM
    Ok. One more time. The addition to the script provides for two options.

    OPTION 1: ping a server or IP address

    OPTION 2: check for active network adapters

    I have set the attached script for OPTION 2. Read the notes at the top of the script.

    As Scott mentioned, there is some network overhead for OPTION 1. This will not be the case in OPTION 2 since no network communications are required.
    Attached Files
  3. File Type: txt BootMonitor.vbs.txt (4.7 KB, 270 views)

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Wall mount for cable, how do I prepare for cable line? [ 3 Answers ]

I want to move my T.V. across the room, I have a wall mount with the wire there. What do I do to the wire that is not cable prepared to look like the one that is now being used? I need step by step instructions. If anyone can help me please!! :confused: Signed single mom trying to save a few...

Cable plugged in but appears as unconnected to LAN [ 3 Answers ]

Cat 5 connected to laptop. Appears as unconnected and won't connect to LAN. Cables have been changed and tried on other connections. All other laptops/computers work on same cable/connections. I have tried disabling, re enabling, deleting the internal network card, updating to no avail. Anyone have...

Tub drain is plugged. [ 4 Answers ]

Hello, My tub is not draining at all, not one bit, less than a day earlier it was working just fine. I have plunged, snaked, and used chemicals. My drain pipe is in a heated space. I'm at a loss, so I'm starting to think wacky things like an animal has gotten into the vent stack and is...

Slow logon when network cable plugged [ 1 Answers ]

Hello all. I seem to be having a problem with my logon speed. I have 2 ethernet cards in both of my PCs. I use one card on each PC to connect to the internet via a router, and this setup is fine. But I recently connected my PCs together using the other ethernet cards and a crossover cable. ...

Shutdown LAN [ 13 Answers ]

Dear all, Please help me in this matter , I want to shut down the LAN with password proetected.It Is possible. Please help me to do this to stop LAN from working... Please help me urgent


View more questions Search