Command Prompt Remote Shutdown


  1. Posts : 5
    Windows 7 Professional x64
       #1

    Command Prompt Remote Shutdown


    Hi All

    I was hoping someone could help me and see if it could be possible for the below, I have setup a script/batch file to remote shutdown several PCs which all work fine without any issues as long all the machines are turned on then it will go through the list one by one and push down the command to each machine, what I'm having issues with is for example

    If I have 5 machines 1,2,4,5 are turned on and PC3 was currently off. the batch file would run through and send each command down turning off PCS 1,2 then it would sit there trying to send the command to PC3 (now this machine is turned off) - I would then get an error message as shown below - it would then move onto PC4,5 - this is all well and good but if I have 100 machines and only 30 are turned on I need to wait a long time for all to be turned off with these error message.

    Error:

    The entered computer name is not valid or remote shutdown is not supported on the target computer. Check the name and then try again or contact your system administrator. (53)



    All I want to do is push down the command with waiting for a response whether the PC is up or not, this would bypass checked for a ping response (if it did this)

    Can this be possible, i have looked online and can't see anything to use
    Attached Thumbnails Attached Thumbnails Command Prompt Remote Shutdown-capture.jpg  
      My Computer


  2. Posts : 66
    Microsoft Windows 7 Ultimate 32-bit 7601 Multiprocessor Free Service Pack 1
       #2

    Marc, hopefully the following link will do the trick. According to the description, this won't hang up if a computer is already off. Here's a link to the Microsoft Technet page:

    https://gallery.technet.microsoft.co...6bdbfc#content

    Let us know if it works. Good Luck!
      My Computer


  3. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #3

    I suggest performing a ping test prior to sending the shutdown request. That way you’ll have more control over the waiting times.

    Because ping can sometimes fail to set the error level, the content of the ping needs to be checked to determine whether the host is alive.
    Code:
    ping -n 1 127.0.0.1 | find "TTL=" >nul && (
    	echo The host is alive, commencing shutdown command…
    ) || (
    	echo The host is not active
    )
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:12.
Find Us