Command Prompt Remote Shutdown

MarcChamberlain

New member
Local time
11:01 AM
Messages
5
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
 

Attachments

  • Capture.JPG
    Capture.JPG
    35.5 KB · Views: 26

My Computer

Computer type
PC/Desktop
OS
Windows 7 Professional x64

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Microsoft Windows 7 Ultimate 32-bit 7601 Multiprocessor Free Service Pack 1
CPU
Pentium(R) Dual-Core CPU E6500 @ 2.93GHz
Motherboard
Gigabyte Technology Co., Ltd. EP45-UD3L
Memory
G.Skill 2.00 GB
Graphics Card(s)
NVIDIA GeForce 8400 GS
Sound Card
High Definition Audio Device
Screen Resolution
1680 x 1050 x 32 bits (4294967296 colors) @ 59 Hz
Hard Drives
(1) ST1500DL003-9VT16L ATA Device (2) WDC WD3200AAKS-00L9A0 ATA Device (3) WDC WD7501AALS-00J7B0 ATA Device
Antivirus
MSE, Avast 17.2
Browser
Firefox
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

Computer type
PC/Desktop
OS
Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
Back
Top