Friday, 27 March 2015

SHUT DOWN CODE IN C.

This program is modification/implementation  of  last program "of  shutdown your computer through programming"
.
.
.
#include<windows.h>
#include<iostream>
using namespace std;
int main()
{
int x;
cout<<"x=1-shutdown\n";
cout<<"x=2-logoff\n";
cout<<"x=3-restart\n";
cout<<"x=4-hibbernet\n";
cin>>x;


switch(x)
{
case 1: system("shutdown/s");
break;
case 2: system("shutdown/l");
break;
case 3: system("shutdown/r");
break;
case 4: system("shutdown/h");
break;
}
return 0;
}



2 comments:

Unknown said...

This program is not working in windows 7 OS.
good luck for next time.

Somesh Sah said...

dear akash,
this prgm is run on windows 8 os.
for windows 7 ...you need to change some statements..
like
case 1: system("shutdown-s");
break;
case 2: system("shutdown-l");
break;
case 3: system("shutdown-r");
break;
case 4: system("shutdown-h");
break;

WINDOWS SUBSYSTEM FOR LINUX

Microsoft partnered with Canonical (creator of Ubuntu) to bring Linux environment experience in Windows 10. Through Windows Subsystem F...