For Win98 this should do it:
Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Integer, ByVal dwReserved As Integer) As Integer
'constant names speak for themselves : )
Const EWX_LOGOFF = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
'then in some sub or function
ExitWindowsEx(EWX_REBOOT, 0) 'or whichever you want to do
Note that this will not work on Win2000 and NT type of OSs.