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;
}
.
.
.
#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:
This program is not working in windows 7 OS.
good luck for next time.
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;
Post a Comment