0

I use this command in autoit to turn off my laptop, if a timer runs out

Run(@SystemDir & "\shutdown.exe /f /s /t 10", "", @SW_MAXIMIZE)  

It works fine most of the time, but occasionally I get the BlueScreen when turning the computer on, usually before the log on screen and after the Windows logo animation completes. Is this because of turning off the computer directly using the shutdown command, or can there be other issues? I should point out that when ever my autoit script shuts off the computer, usually there are multiple browsers with multiple tabs open, along with other applications running. So I want to know,

What is the difference between shutting off the computer through the start menu, by directly pressing the power button, and by issuing the shutdown command from the autoit script? Is abruptly shutting down the computer using the shutdown command while other user applications are running dangerous in any way?

My OS is Windows 7 and computer is a laptop

user13267
  • 1,873

2 Answers2

3

To answer the question:

The shutdown command is what your computer runs when you press the power button (if you have shutdown assigned it), or by shutting down through the start menu. The command is provided by Microsoft, and therefore shouldn't cause a BSOD, especially in your case where the BSOD is happening at startup.

Using the /f and/or /t 0 options wouldn't cause hardware problems either, it would only cause applications problems if that (applications not shutting down properly, unsaved work, etc).

In your case:

You would have to post the contents of your crash dump in order for anyone to determine what is actually causing the BSOD. Many times it's related to peripherals/drivers, but it could be anything.

As suggested in comments, you could see if anything is in the Event Log, but since your BSOD is happening before Windows has booted, there's a lower chance you'll find what's actually causing it. The crash dump will be a much more reliable source.

0
/f         Force running applications to close without forewarning users.
       The /f parameter is implied when a value greater than 0 is
       specified for the /t parameter.

So unless you do /t 0 without f this is endtasking everything (it can't close) it appears.

It does shut down the computer rather than just doing what pulling the power cable out would do.

I couldn't tell you there is any other factors (autoit even) but I haven't had a blue screen from the command myself.

sabgenton
  • 684