Click here to Skip to main content
15,894,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sup,

I tried creating a small programm to test the shutdown command 30 mins ago.

program code:

import os
os.system(´shutdown-s´)

Now instead of shutting down, windwos started preparing(30 mins ago)

Any ideas what could have gone wrong? Or what i should do now?

What I have tried:

I only tried waiting and conecting it to a power source, but it doesn´t seem to do anything. Im wondering if it randomly decided to update.

It is a laptop btw.
Posted
Updated 10-Dec-18 22:43pm

At a guess Windows is preparing to install a major update. Calling shutdown form inside an application is never a good idea.
 
Share this answer
 
The correct syntax for Windows shutdown is 'shutdown /s'. In any case the script must be executed with administrator rights in order to actually shutdown the system.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900