1.

Solve : dos shutdown command?

Answer»

I am trying to shutdown 157 windows XP WORKSTATIONS using the following bat FILE.
"shutdown -r -f -c " Automatic system restart has been called for by the system administrator. Shutdown will BEGIN in 30 seconds".

Can I use wildcards and the -m \\abc** for system names.

Example "abc**" for system named abc01, abc02 ect.
I only want to shut down and restart certian pc's in the domain.

The domain server is running Server 2003.

ThanksYou can't use wildcards for the shutdown command, but you could probably do something like this in a batch file:

Code: [Select]@echo off
for /f "tokens=*" %%a in ('net view ^| findstr /i /b "\\\\abc"') do (
echo Rebooting %%a
shutdown.exe -r -f -m "%%a" -c " Automatic system restart has been called for by the system administrator. Shutdown will begin in 30 seconds"
)
As with all batch scripts, this should be tested in a controlled environment before run on a live network.



Discussion

No Comment Found