Search This Blog

C Program to Logoff or Signout From Windows

You can logoff (also called logout or sign out) from a windows computer using c program. This can be done by executing a command. You just have to execute the command shutdown /l which executes shutdown.exe with command line parameter /l to force logout from Windows. The system() function in c can be used to execute any system commands. Therefore, the following simple c program when executed, will logout you from Windows instantly.


#include<stdio.h>
void main()
{
system("shutdown /l");
}

No comments: