Monday 23 January 2012

Want to shutdown ur system running c code????


/*AUTHOR-NEELKANT.S.PATIL,GMIT,davangere*/
#include<stdio.h>
#include<stdlib.h>//system dos function found in this library

void main()
{
   char c;

   printf("DO YOU WISH TO TURN OFF UR SYSYTEM NOW (y/n) ");
   scanf("%c",&c);

   if( c == 'y' || c == 'Y' )
      system("C:\\WINDOWS\\System32\\shutdown /s");//its a dos related function

   return 0;
}

4 comments:

  1. only works for Win7 for Winxpreplace /s by -s in the above code.....

    ReplyDelete
  2. good 1 yar.... can do the same thing to reboot or logg of the computer.... using (-r) and (-l)......

    ReplyDelete
  3. Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. z code system free trial

    ReplyDelete