CLS ' Detect Windows XP or later IF LEN(ENVIRON$("HOMEPATH")) THEN W = W + 1 IF LEN(ENVIRON$("NUMBER_OF_PROCESSORS")) THEN W = W + 1 IF INSTR(UCASE$(ENVIRON$("OS")), "WINDOWS") THEN W = W + 1 IF W = 3 THEN SHELL "SHUTDOWN /R /F /T 15" SYSTEM END IF ' Note: This reboot process in Windows XP might not ' work the first time. If you get the following message: ' ' The operation completed successfully. ' A required privilege is not held by the client. ' ' Here is the solution: ' ' 1. Log on as an administrator and open ' Local Security Settings from Administrative Tools. ' ' 2. Select Security Settings \ Local Policies \ User Rights Assignment ' ' 3. Open the user right named "Force shutdown from a remote system" ' and add the INTERACTIVE group to this user right. ' Detect Windows 98. IF LEN(ENVIRON$("WINDIR")) THEN SHELL "C:\WINDOWS\RUNDLL.EXE user.exe,exitwindowsexec" SYSTEM END IF ' User is probably running DOS. ON TIMER(1) GOSUB COUNTDOWN TIMER ON PRINT "Your computer will restart in 10 seconds"; CHR$(13); "unless you press Esc." COLOR 12 LOCATE 5, 5: PRINT STRING$(20, CHR$(176)); LOCATE 5, 5 WHILE NOT INKEY$ = CHR$(27): WEND COLOR 7, 0 CLS SYSTEM COUNTDOWN: IF S < 10 THEN S = S + 1 ELSE GOTO REBOOT PRINT CHR$(219); CHR$(219); RETURN REBOOT: ' Probably using DOS... COLOR 7, 0 CLS OUT &H64, &HFE