how can i make a dos application restart the user computer?
how can i make a dos application restart the user computer?
Code:system("shutdown -s -f -t 0");
My best code is written with the delete key.
judging from the information you gave us, try usingCode:system("reboot -q");
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
or
system is a function included in cstdlib that simply executes the OS command given to it as a string parameter. It's usage is often advised against for a number of reasons, but considering you have specified that this is a DOS program, most of those concerns go away. Just be aware that if there is another way to do something, system should generally be avoided. In this case, feel free.Code:system("warm")
... and you're probably curious as to what those reasons are. Basically they're two fold:
1) Unexpected bahavior if the program has been moved, replaced, deleted, etc...
2) OS - dependant (this concern does not matter in this case)