Shut Down Windows from VB This code will be especially useful in setup programs when you want to restart the system, so that it refreshes everything, and the program becomes properly runnable. Anyway, here's the code to shut down Windows 95. 1. Place this code in the Declarations section of the Form: Const EWX_LogOff As Long = 0 Declare Function ExitWindows Lib "User32" Alias "ExitWindowsEx" (ByVal dwOptions As Long, ByVal dwReserved As Long) As Long 2. Add this code to where you want to shut down from (eg. Command1_Click): ExitWindows EWX_LogOff, &HFFFFFFFF This code will only work from an EXE file. That means that you will have to compile this fila as an EXE, and if you want to, save this project. When the project is compiled, close all instances of VB you have open, and probably all other programs you would have open. Run the EXE, and click on Command1 (or whatever you made the trigger as). The Windows session should shut down.