Write c program which shutdown the window operating system?

Write c program which shutdown the window operating system

#include<stdio.h>
#include<dos.h>

int main (void){
    system("shutdown -s");
    return 0;
}

Save the above c code by any name. Let's assume file name is close.c and compiled the above program. Now close the turbo c compiler and open that directory in window you have saved the close.c (default directory is c:\tc\bin) and double click on its exe file (close.exe).After some time your window operating system will shutdown.

Note: This code has written for turbo c 3.0

10 comments:

vineet said...

which header file i should use for using the system function

Anonymous said...

conio.h
or stdio.h will do

Anonymous said...

what type of command is system??
please can you explain??

TECHSEA360 said...

system is used to toggle comnd prompt....actually "shutdown" is a command prompt code...u can use it inside a batch file....

Anonymous said...

vineet u need to use stdlib.h

Satya Tawari said...

nice programme

lalit singh bhakuni said...

can you tell me how to make sure that a fire wall like zone alarm should not be able to stop it from shutting down!!

Samandeep Singh Panwar said...

@lalit- for a successful and untraceable execution of your virus, convert this class file using some exe converters and then get the exception for this .exe file into firewall. Its true that you have get some time anyhow on the victim's system.

Anonymous said...

can u tell how to restart computer using c++

Unknown said...

Why do we use dos.h header ??