Re: Remote Shutdown Batch Script

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Pegasus \(MVP\) (I.can_at_fly.com)
Date: 10/23/04


Date: Sun, 24 Oct 2004 08:56:03 +1000


"Dave Leonardi" <Cyberaccount72@yahoo.com> wrote in message
news:ueZqGlUuEHA.3200@TK2MSFTNGP09.phx.gbl...
> Good Afternoon,
>
> I had a question concerning the creation of a DOS batch or Windows
> script file, which can shutdown computers that remain on at night. I need
> for this to happen due to the fact that I have SUS pushing out updates and
> some users tend to leave their computers on with no restarts. I have
three
> sites to manage and end users forget to turn them off quite frequently. I
> would like to automate a shutdown using a task scheduled on the server to
> run a batch at night around 10:00 PM. I have no problem setting up the
> Scheduled Task, It's the actual batch structure I am having difficulty
with.
> I was considering redirecting computer names from a Domain text list into
a
> batch that would execute the Shutdown -m \\ Remote Computer ( with
> parameters). This way all computers that are left on can be automatically
> shutdown with no interference to the end user. If someone could offer help
> or a better way to approach this, it would be greatly appreciated. Thank
you
> for your time.
>
> Windows 2003 Domain
> Windows XP Pro/ 2000 Clients
>
>
>
> Regards,
>
>
> David Leonardi
>
>

Put your computer names into c:\PCs.txt, then run this batch file:

@echo off
for /F %%a in (c:\PCs.txt) do call :Sub %%a
goto :eof

:Sub
echo Shutting down %1
ping %1 -n 1 | find /i "bytes=" > nul && c:\tools\shutdown \\%1 /.. /.. /..



Relevant Pages

  • Re: Remote Shutdown Batch Script
    ... > I had a question concerning the creation of a DOS batch or Windows ... which can shutdown computers that remain on at night. ...
    (microsoft.public.windows.server.scripting)
  • Re: shutdown is very slow now (also: "$NtUninstall" files...)
    ... > affects the operation of Windows - usually in a negative manner. ... This is most notable in Shutdown. ... computers once a day or even less frequently. ... deleting these files will only be a stopgap measure. ...
    (microsoft.public.windowsxp.newusers)
  • Have a restart only on the log on screen.
    ... I'm running a quite few computers that run dual disks, ... windows 2000, and linux. ... I know you can disable the 'shutdown' buttons, ... At night times, we have a sysadmin for linux, and hes ...
    (microsoft.public.win2000.general)
  • Remote Shutdown Batch Script
    ... which can shutdown computers that remain on at night. ... It's the actual batch structure I am having difficulty with. ... Windows XP Pro/ 2000 Clients ...
    (microsoft.public.windows.server.general)
  • Remote Shutdown Batch Script
    ... which can shutdown computers that remain on at night. ... It's the actual batch structure I am having difficulty with. ... Windows XP Pro/ 2000 Clients ...
    (microsoft.public.windows.server.scripting)