0
       #include <iostream>
       #include <conio>
       #include <windows>

       void main()

       {
        int  opt;
        cout<<"\t\twhich type of window you have\n\t\tEnter one for shoutdown for windows xp\n\t\tEnter 2 for windows 7\n";

        switch(opt)
        {
         case 1:
         system("C:\\WINDOWS \\System32\\shutdown-s-t-0");

         break;
         case 2:
         system("C:\\WINDOWS \\System32\\shutdown/s/t 0");
         break;

        }



       getch();}

using borland execute that program and shutdown your computer ...................
4
Contributors
9
Replies
49
Views
4 Years
Discussion Span
Last Post by deceptikon
1

which version of Borland compiler? You would have to have a 32-bit version in order to access the win32 api functions. Can't do that with Turbo C or Turbo C++. Here are the functions you will need.

Edited by Ancient Dragon

0

Borland C++ version 5.i think you can do it with turbo c or turbo c++ .first compile and run the above file then run that file and generate the .exe file ..and click the .exe file and use it.

0

.i think you can do it with turbo c or turbo c++ .

Yes, the posted program will work if compiled with a 32-bit compiler, not sure if it will with Turbo C or not because Turbo C may not be able to "see" the c:\windows folder since it doesn't know anything about NTFS file system or long file names.

I thought you were asking how to shut down MS-Windows os. If that was not your intent then maybe you should have posted this as a Code Snippet which is something to show us how to do something instead of asking a question.

Edited by Ancient Dragon

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.