top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How we can shutdown windows operating system using c program?

+2 votes
104 views
How we can shutdown windows operating system using c program?
posted Nov 3, 2014 by Akriti

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Try something like this -

#include <dos.h>
void main (void){
    system("shutdown -s");
}

compile the above program and save it as .exe file. Now run this program (may be u need to run as admin) and in few seconds your windows operating system will shutdown.

answer Nov 3, 2014 by Salil Agrawal
Similar Questions
+1 vote

Does Tomcat server support Graceful Shutdown (like all other App Servers: Weblogic, Websphere), where new requests are rejected, and the server finishes in-flight work on existing requests?

Something like the apachectl -k graceful, but instead to restart to stop the server.

0 votes

Can we shutdown the PC using C program if yes please help me?

0 votes

How we can add two 64 bit number on 32 bit machine using c/c++ program ?

+1 vote

I am currently running RHEL 6.5 on a 64-bit laptop, and installed a new fedora 20 VM using the Virtual Machine Manager -- seemed to work fine, f20 came up, looks good, but now i want to shut it down, so from the f20 console, I selected "Virtual Machine" -> "Shut Down" -> "Shut Down".

Where it *looks* like the VM shuts down, but the VMM window shows "f20 Running"

Should I expect a different result? I was expecting the VMM window to show that that VM was Stopped or something.

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...