Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a simple .bat script to shutdown a kiosk style machine in our work

shutdown -h -f

this hibernates the machine and I have it running each evening as a scheduled job. However my problem comes when I turn the machine on again. The first time I press power it starts up and then immediately hibernates again, like it runs the script a second time.

the second time I press power it stays up.

Any suggestions on how I can avoid this?

share|improve this question
    
Have you tried disabling hibernation, rebooting, and then re-enabling it? Does it do this EVERY time, or is it intermittent? –  Ƭᴇcʜιᴇ007 Nov 9 '12 at 20:53
    
It does it every time, though I'm sure it used to work without doing this, maybe an update made a change. –  Toby Allen Nov 9 '12 at 20:56
    
Does the script run on an event or it is at a certain time? –  awright18 Nov 9 '12 at 23:20
    
@awright18 Runs at a certain time 8pm every evenign. I switch it on next morning between 9am - 10am –  Toby Allen Nov 11 '12 at 8:26
1  
check windows event log...might give some clue –  tumchaaditya Nov 21 '12 at 2:34

2 Answers 2

up vote 1 down vote accepted
+100

You could try to schedule the shutdown.exe program itself, rather than the script.

share|improve this answer
    
I'll see if that solves my problem. –  Toby Allen Nov 18 '12 at 19:18

First of all check the task scheduler for any other tasks that may be hibernating your PC before this task even runs and just to be sure check if anyone or anything else is hibernating the PC before the event runs ;) what I think is that this task is always being missed and it tries to run as soon as it can so it runs right after turning on your PC. *check the task history and see if it's been running on the scheduled time.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.