Jump to content


Photo

Shutdown Remote win 2k3 server with C++


  • Please log in to reply
1 reply to this topic

#1 JD [email protected]

JD [email protected]

    Young Padawan

  • Members
  • Pip
  • 9 posts

Posted 22 May 2008 - 09:40 AM

How do I shutdown or restart a remote windows 2003 server using C++ ?

What is the code?

Thanks

posts merged:

make that windows 2000 * :)

#2 JoeyMagz

JoeyMagz

    Young Padawan

  • Members
  • Pip
  • 79 posts
  • Gender:Male
  • Location:Chesapeake, VA

Posted 13 August 2008 - 10:07 PM

I know this is really late for the question but here's the answer.

ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCEIFHUNG, -1);

That's for anyone else who was wondering. Also, all I did was go into visual c++ and started typing random words that had to do with leaving or quitting and that popped up in the little tooltip box. :) It's always better to experiment with programming before asking questions. Happy programming!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users