Wednesday, 16 November 2016

How to shutdown your pc using a c-program

If you are on windows 7 and above (type this codes in c )



#include
#include

int main()
{
   system("C:\\WINDOWS\\System32\\shutdown /s");

   return 0;
}


###########################------------------########$$$$$$$$$$$$$

If still use ancient windows XP (than type this)



#include
#include

int main()
{
   char ch;

   printf("Do you want to shutdown your computer now (y/n)\n");
   scanf("%c", &ch);

   if (ch == 'y' || ch == 'Y')
      system("C:\\WINDOWS\\System32\\shutdown -s");

   return 0;
}

No comments:

Post a Comment

General PC Tips

  Adjust any setting on your PC with the Windows “God Mode” folder, which is a centralized Control Panel for all the OS settings. Access thi...