Posts with the tag code snippets:

How to Shutdown your PC using Python ?

If you want to shutdown your Windows PC from your Python code, just use this code snippet. import os os.system("shutdown /s /t 1") That’s it. I hope this helps. Do you recommend reading this blog post? share it!

How to Shutdown PC using C++ ?

If you want to shutdown your Windows PC from your C++ code, use this code snippet. #include <stdio.h> #include <stdlib.h> int main() { system("c:\\Windows\\system32\\shutdown /s"); return 0; } I hope this helps. Do you recommend reading this blog post? share it!