Question

  • Creator
    Topic
  • #2151912

    Network/Computer Technician

    Locked

    by schmidtmjs ·

    I am trying to figure out a way to automatically shutdown windows xp computers but also give the user the option to abort the shutdown in case they are on and using the computer. This is in efforts to shutdown computers at night that should have been shutdown by the user before they leave for the day to conserve energy in these difficult budget times. Does anyone have a VB Script that will automatically start the shutdown process? The plan would be to have a scheduled task on each machine to kick off the VB Script. I need help in showing a box saying “This computer will shutdown at 8:00pm” and have that box appear on the computer screen 10 minutes before the actual shutdown. I also want there to be an option (cancel button) for the user to cancel or abort the shutdown in case they are there using the computer. Any help would be greatly appreciated.

    Thanks

All Answers

  • Author
    Replies
    • #2777877

      Clarifications

      by schmidtmjs ·

      In reply to Network/Computer Technician

      Clarifications

    • #2777865

      Re: Shutdown

      by pshiflet-24 ·

      In reply to Network/Computer Technician

      You can create a scheduled task to run shutdown.exe located in the system32 folder. The command line switches you would want to include -f to force the shutdown and -s to shutdown. In the “Advanced Options” for the scheduled task is a check box to stop the task if the computer ceases to be idle (i.e. somebody is using it at that time). You could create a script to do this and have the scheduled task run the script but the scheduled task alone should do the trick.

      If you need a more detailed explanation or you have further questions, please let me know. Thanks.

      • #2774318
        Avatar photo

        what about hibrnate

        by alashhar ·

        In reply to Re: Shutdown

        really the question raised a question which is in my brain for long time.

        i provide IT support for small company. in my antivirus server, i make daily scan schedule for all the PCs in the night. i told the users to do not shutdown their PCs. but some users forget to do that.

        how i prevent the users to do not shutdown their pcs, and instead they can hibrnate the pc or logo ff only?

        how i can schedule the PCs to hibernate by itslef?

        how i can enforce wake the PCs from server?

        • #2774315

          You can prevent the user from shutting down

          by computercookie ·

          In reply to what about hibrnate

          by using Group Policy ‘Administrative templates’ > ‘Windows components’ > ‘Start Menu and Taskbar’ > ‘Remove and prevent access to the shutdown command’

        • #2949651

          Here’s the method I use

          by petere ·

          In reply to You can prevent the user from shutting down

          You can create a batch file with the following commands in it:

          @echo
          off
          shutdown.exe -s -f -t 90 -c “Double Click abort Icon on Desktop to keep using this workstation!”

          Use the job scheduler to run this batch file at your preferred time.

          This gives the person 90 seconds to abort before the shutdown initiates, and gives them a message prompting them to abort if they want to keep working.

          Then, put a shortcut on each user’s desktop to abort the shutdown. To do this, nav to c:\windows\system32 and right-drag shutdown.exe to the desktop. Choose “create shortcut here.” Rename the shortcut to Abort Shutdown and then edit the properties of the shortcut. On the Shortcut tab of the properties window, change the target to C:\WINDOWS\sytem32\shutdown.exe -a (this is the abort.) Then click the change con button and choose the red circle with the slash through it. Test, and you’re done.

    • #2774317

      forget VB try batchfile

      by computercookie ·

      In reply to Network/Computer Technician

      have a look at the shutdown help data, anyone with some skill can type in the run command shutdown -a

    • #2949586

      you could try a batchfile…

      by snuffy09 ·

      In reply to Network/Computer Technician

      syntax: shutdown -m (remote machine switch) x.x.x.x (ip) -f (force action) -s (shutdown, can use -r to restart) -t (delay time switch, 30 seconds is default if -t switch is not used) xx (warning time, in seconds)

      ex.) “shutdown -m 192.168.1.2 -f -s -t 45”

      save as a batchfile then use windows task scheduler to run when you want.

      hope this helps post back

Viewing 3 reply threads