How to write a program in c program that shuts down a computer in 20 seconds

Hello,how can i write a program in c that shuts down a computer in 20 seconds
6 answers Last reply
More about write program program shuts computer seconds
  1. Why in C? Easier in a batch file!

    shutdown /t 20
  2. Or just create a shortcut on the desktop using

    Quote:
    Shutdown.exe -s -t 00

    s shuts it down and the 00 is the countdown timer in seconds.

    for a complete list of options for the dos commands look here http://pcsupport.about.com/od/commandlinereference/p/shutdown-command.htm
  3. Sounds suspiciously like a class assignment.
  4. ex_bubblehead said:
    Sounds suspiciously like a class assignment.



    lol yea. On a related note, can anyone tell me how to program a "Hello World" message?

    EDIT: Thought I better add a j/k to prevent any questions on what language I need it in hehe.
  5. ianocar said:
    hello ianocar it looks so nice question you have made, but i seen one tutorial, it just made me write program in seconds, you can also take a look at this tutorial , http://www.invatac.com/2012/09/how-to-write-program-in-c.html
    http://www.invatac.com/2012/09/how-to-write-program-in-c.html
  6. There is a application already for this :bounce: DShutdown it does exactly what you want and more.

    By a timer, time of day, when a application closes, whatever. It can Shutdown, sleep, suspend, hibernate etc etc...
Ask a new question

Read More

Computers Windows 7