+ Post New Thread
Results 1 to 8 of 8
Windows Thread, Shutdown Script - Simple Question in Technical; Could someone remind me of the switch to make shutdowns optional, I run a simple script from task scheduler in ...
  1. #1
    M0MST
    Guest

    Shutdown Script - Simple Question

    Could someone remind me of the switch to make shutdowns optional, I run a simple script from task scheduler in server 2008 r2 which just shutsdown any machines left on, however sometimes staff are still here or the site manager is working, I have just forgotten the switch to make it optional, below is our script

    Shutdown -f -s -m \\ICT-01

    Thanks
    Dan

  2. #2

    bladedanny's Avatar
    Join Date
    May 2009
    Location
    Sheffield
    Posts
    1,314
    Thank Post
    191
    Thanked 313 Times in 234 Posts
    Rep Power
    171
    I'm not sure you can using the shutdown.exe command. I use psshutdown to do it here which I know there is a switch to cancel it. Plus you can specify a text file list of computers so you dont have to have one per line in a .bat file.

    Hope this helps.

  3. Thanks to bladedanny from:


  4. #3
    chrisbrown's Avatar
    Join Date
    Aug 2010
    Location
    Melbourne, Australia
    Posts
    103
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    17
    shutdown.exe doesn't allow for cancelling without running "shutdown.exe -a" which obviously most people cannot (command prompt is likely disabled, and the user probably couldn't work out how to run it anyway). There's a million free programs out there which will give you the option, I'm with the psshutdown recommendation.

    You *do* have PSTools installed on your management server, right?

  5. #4
    kennysarmy's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    1,401
    Thank Post
    93
    Thanked 48 Times in 34 Posts
    Rep Power
    31
    I do this:


    @echo off
    REM Copies shutdown executable to local computer from network location and sets shutdown times in Scheduled Tasks.
    REM Script also checks for name of pc and if found to be a server ie fp* does not copy file or add tasks.


    @set str=%computername%
    @set pos12=%str:~0,2%
    @echo %pos12%

    REM If computer name starts FP* ie one of the servers then do nothing
    if %pos12%==FP goto End

    REM If computer name starts IL* ie the ILIBRA server then do nothing
    if %pos12%==IL goto End

    REM Else carry out adding tasks below

    if not exist "c:\shutdown.exe" copy "\\fp4\shapps\shutdown\shutdown.exe" c:\

    at /delete /yes
    at 09:10 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."
    at 10:10 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."
    at 11:05 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."
    at 11:30 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."
    at 12:30 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."
    at 13:30 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."
    at 14:15 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."
    at 14:45 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."
    at 15:45 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."
    at 16:45 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."
    at 18:00 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER."

    :END

  6. Thanks to kennysarmy from:


  7. #5

    Join Date
    Nov 2007
    Location
    Rotherham
    Posts
    1,679
    Thank Post
    122
    Thanked 126 Times in 102 Posts
    Rep Power
    46
    Quote Originally Posted by bladedanny View Post
    I'm not sure you can using the shutdown.exe command. I use psshutdown to do it here which I know there is a switch to cancel it. Plus you can specify a text file list of computers so you dont have to have one per line in a .bat file.

    Hope this helps.
    What do you do with Win7 Machines which winge with the "interactive services" message?

  8. #6
    M0MST
    Guest
    Quote Originally Posted by bladedanny View Post
    I'm not sure you can using the shutdown.exe command. I use psshutdown to do it here which I know there is a switch to cancel it. Plus you can specify a text file list of computers so you dont have to have one per line in a .bat file.

    Hope this helps.
    Excellent

    Ill have a look at that

  9. #7

    bladedanny's Avatar
    Join Date
    May 2009
    Location
    Sheffield
    Posts
    1,314
    Thank Post
    191
    Thanked 313 Times in 234 Posts
    Rep Power
    171
    Quote Originally Posted by Stuart_C View Post
    What do you do with Win7 Machines which winge with the "interactive services" message?
    Sorry, I've not had to look into that yet as only have XP here atm.

  10. #8
    M0MST
    Guest
    Quote Originally Posted by chrisbrown View Post
    shutdown.exe doesn't allow for cancelling without running "shutdown.exe -a" which obviously most people cannot (command prompt is likely disabled, and the user probably couldn't work out how to run it anyway). There's a million free programs out there which will give you the option, I'm with the psshutdown recommendation.

    You *do* have PSTools installed on your management server, right?
    No I do not yet have PSTools installed, I will look as PSshutdown and give it a go.

    Thanks all



SHARE:
+ Post New Thread

Similar Threads

  1. shutdown script for Macs
    By Tony_Mc in forum Mac
    Replies: 3
    Last Post: 15th October 2009, 02:04 PM
  2. Shutdown Script
    By monkeyx in forum Scripts
    Replies: 37
    Last Post: 29th April 2009, 02:03 PM
  3. Script to shutdown computers.
    By FN-GM in forum Scripts
    Replies: 18
    Last Post: 17th November 2008, 04:43 PM
  4. Shutdown Script
    By andrew_91090 in forum Scripts
    Replies: 3
    Last Post: 1st October 2008, 03:03 PM
  5. Logon script & Printer script question.
    By Galway in forum Windows
    Replies: 3
    Last Post: 29th August 2007, 12:00 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •