Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: dos shutdown command  (Read 5015 times)

0 Members and 1 Guest are viewing this topic.

azmarkk

    Topic Starter


    Newbie

    dos shutdown command
    « on: July 27, 2008, 09:38:28 PM »
    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.

    Thanks

    GuruGary



      Adviser
      Re: dos shutdown command
      « Reply #1 on: July 28, 2008, 03:45:23 PM »
      You 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.