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

Author Topic: Scheduling Shutdown  (Read 3292 times)

0 Members and 1 Guest are viewing this topic.

wissamyoussif

    Topic Starter


    Beginner

    Scheduling Shutdown
    « on: February 27, 2008, 10:18:10 PM »
    Hi all,
    I'm too shy to ask my sisters to stop playing, quit listening to music and turn off my machine when I go to sleep; so I've tried this: I typed shutdown.exe -s -t 03 -f on notepad, saved it as a .cmd file (and changed later to .bat), and tried to schedule it to run at 10:30 pm every night. However, when I try to "open advanced properties for this task" I get a "new task has been created, but may not run because the account information could not be sent" then when I'm done with the advanced (shedule) tab, click ok, I get an " error has occured while attempting to set task account information ... you do not have permission to perform the requested operation".
    What's wrong with that task anyway, knowing that this all works well with the (defrag.exe) task that I did the same procedure to schedule and with no problem?
    Thanks

    GuruGary



      Adviser
      Re: Scheduling Shutdown
      « Reply #1 on: February 28, 2008, 11:30:34 PM »
      Look at the scheduled tasks log file at C:\Windows\Schedlgu.txt which should give you more information.

      Did you enter your username and password properly for the scheduled task?  Is the specified account an administrator account?

      wissamyoussif

        Topic Starter


        Beginner

        Re: Scheduling Shutdown
        « Reply #2 on: March 04, 2008, 04:49:30 AM »
        Hi GuruGary and all,
        thanks for your interest and prompt response. By the time I posted my first lines, everything was checked and rechecked over and over so it's not probable that there's any account problem (the machine is mine and I don't have any password on it); and Schedlgu.txt yielded

        "sd.job" (shutdown.exe) 26/02/2008 10:30:00 م ** ERROR **
           The attempt to retrieve account information for the specified task failed; therefore, the task did not run. Either an error occurred, or no account information existed for the task.
           The specific error is:
           0x8004130f: No account information could be found in the Task Scheduler security database for the task indicated.

        I think I'm the first one who thought to schedule Shutdown (please tell me I'm wrong) so can I still do it?

        blastman



          Hopeful

          Re: Scheduling Shutdown
          « Reply #3 on: March 04, 2008, 10:57:29 AM »
          I think I'm the first one who thought to schedule Shutdown (please tell me I'm wrong) so can I still do it?

          you not the first.

          I use a bacth file to restart my servers for windows updates out of office hours of course (and before the backups run!!!)

          below is said bacth file (nice and easy..)

          Code: [Select]
          shutdown /r /t 5 /c "Apologies for any inconvenience." /f /d p:4:1
          you'll want to remove the /r as that will restart said machine.

          I've added it as a scheduled task and when ever i want to run it i just schedule it for that night. easy.

          Blastman, you are the man. Thank You Very Much!!!!!!!!!



          wissamyoussif

            Topic Starter


            Beginner

            Re: Scheduling Shutdown
            « Reply #4 on: March 09, 2008, 08:48:46 AM »
            Hi blastman and all, no not even that didn't work with me, it still cannot be added to the Schedule Task. Would anyone suggest me moving to the Windows Forum? 'cause no one here thinks it's a command error. Thanks

            squall_01



              Prodigy

              Thanked: 80
              Re: Scheduling Shutdown
              « Reply #5 on: March 09, 2008, 10:25:36 AM »
              I would try a program called Switch Off.  You can tell it to shut down at what ever time and close any programs that are open.  You can also set up a message in it say that it going to shut down.  I find it alot easier to use.
              Windows 7 RC Tester.  Working on it.  Your monitor says etchasketch on the side!

              If I fall who is there to pick me up now.  I stand alone but I stand as the gaurdian for whom I wish to protect.  The sound of my blade utters my name as you fall.  For I shall not move.  For those that forsake the very people are wosres

              Sidewinder



                Guru

                Thanked: 139
              • Experience: Familiar
              • OS: Windows 10
              Re: Scheduling Shutdown
              « Reply #6 on: March 09, 2008, 11:53:44 AM »
              Quote
              when I try to "open advanced properties

              I'm uncertain what these advanced properties you speak of are, but sometimes brute force works too.

              Code: [Select]
              at 10:30PM /every:m,t,w,th,f,sa,su "shutdown.exe -s -t 03 -f"

              Enter the above command from the command prompt. The job runs under the NT Authority/System user and should set you right up. The job name will be AT#.

              Note: The GUI scheduler and the AT command use two different API's. Jobs scheduled with the GUI cannot be seen by the AT command but jobs scheduled with the AT command can be seen by the GUI.
              The true sign of intelligence is not knowledge but imagination.

              -- Albert Einstein

              wissamyoussif

                Topic Starter


                Beginner

                Re: Scheduling Shutdown
                « Reply #7 on: March 12, 2008, 11:50:33 PM »
                Hi Sidewinder, thanks for your line but that also didn't work and yielded a "Could not start" status in Scheduled Tasks. The Advanced Properties that I've talked and you asked about are those of the task itself when you create a new one using the "Scheduled Task Wizard", after several "Next's" and before the "Finish", you'll be prompted to literally "Open advanced properties for this task when I click Finish".

                Sidewinder



                  Guru

                  Thanked: 139
                • Experience: Familiar
                • OS: Windows 10
                Re: Scheduling Shutdown
                « Reply #8 on: March 13, 2008, 05:46:29 AM »
                There was no other information besides "Could not start"? What code is in the last result column? Did you check the event log, there may be more info there. Who is logged onto this machine when the shutdown starts?

                NT Authority jobs should run no matter who is signed on. On the property sheet for the scheduled job, check the task tab. What is in the RunAs box? Is the Run Only If Logged On box checked? If not you must supply a password for the account. The enabled box must be checked for the job to run.

                 8)
                The true sign of intelligence is not knowledge but imagination.

                -- Albert Einstein

                wissamyoussif

                  Topic Starter


                  Beginner

                  Re: Scheduling Shutdown
                  « Reply #9 on: March 16, 2008, 11:31:09 PM »
                  Hooray Sidewinder, at last it works and finally I can get my daily sleep! The catch was that, by default, the Run Only If Logged On box was unchecked so I checked it. Thanks