Please can anyone help me out of this problem?
I want to know that how can we reboot computer (any OS) using C language?

Re: How to reboot computer via C? 80 80
Member Avatar

That would depend upon OS. For example in windows the WinAPI function is ExitWindowsEx . In other systems its other. In DOS its quite simple as windows one and here an article on that. I dont know about any other.

Re: How to reboot computer via C? 80 80

You may use the system function!

Re: How to reboot computer via C? 80 80

You may use the system function!

That might work with *nix, but not MS-Windows.

Re: How to reboot computer via C? 80 80
#include <dos.h>
system ("shutdown +a"); // to enable automatic shutdown
system ("shutdown -s -t 1"); //to shutdown in 1 second
commented: Oh you are right +18
Re: How to reboot computer via C? 80 80

I just find it suspicious whenever someone shows up and their first post is "how do I reboot". This just screams "kiddie pest" to me.

Just so you know, there is no "any OS" answer to this.

Re: How to reboot computer via C? 80 80

Generalization means Windows as he didn't mention a specific OS.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.