Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
How can I automate a reboot in XP Pro? I have an FTP server on it, Servu 4, and if I leave it on for a while Xfers go well for about 8 hrs(est.) then the domain log reads errors in Xferring the last 2 or 3 files and no one can log in after that. No one has told me the exact error they receive when trying to log in but it goes away if I reboot.
I have Norton IS, AV, Servu 4, XP Pro. Does anyone have any ideas as to how to fix this?
Or, how to automate a reboot? Thanks

Basic Program to Reboot or "Cold" Reboot the Machine
The information in this article applies to:
Microsoft QuickBASIC for MS-DOS 4.0, 4.0b, 4.5
Microsoft BASIC Compiler 6.0, 6.0b
Microsoft Basic Professional Development System for MS-DOS 7.0, 7.1Summary
This article describes three ways to reboot your machine from within a Basic program.WARNING: Be sure to CLOSE all open files before rebooting the computer so as not to lose buffered data.
This information applies to Microsoft QuickBasic versions 4.0, 4.0b, and 4.5; to Microsoft Basic Compiler 6.0 and 6.0b for MS-DOS; and to Microsoft Basic Professional Development System (PDS) 7.0 and 7.1 for MS-DOS.
More Information
Method 1
The first method of rebooting the machine requires only Basic code. This program sends a command directly to the keyboard I/O port using Basic's OUT statement. This causes the keyboard controller chip to reboot the machine just as if you had pressed CTRL+ALT+DEL on the keyboard. Note that this command is supported only on the AT and higher classes of machines. This example will not work on the IBM PC- or XT-class machines or clones.
' REBOOT.BAS
DEFINT A-Z
DEF SEG = &H40 ' If the memory location &H0072:0073 in the BIOS
POKE &H72, &H34 ' data area contains &H1234, then this will cause
POKE &H73, &H12 ' a warm reboot (no self-test or memory
' count). Anything else causes does a cold reboot
' (self-test and memory count).
DEF SEG ' Return to Basic's default segment.
Command% = &HFE ' Reset Processor command.
Port% = &H64 ' Keyboard I/O Port
OUT Port%, Command% ' Reboot
Method 2
Another way to reboot your machine is to jump directly to the ROM BIOS initialization code (which normally executes automatically when the machine's power is first turned on). This method of rebooting the machine should work on all members of the IBM PC and PS/2 family of computers, as well as the clones of these machines.To use this method, however, your chosen language must have support for "pointers to functions" as in C or assembly. Because Basic does not support a function pointer data type, you must write a C or assembly procedure to jump to the ROM BIOS boot code. You can call this C or assembly procedure from your Basic program.
Two separate articles in this Knowledge Base describe how to reboot the MS-DOS computer. One article describes using C alone to reboot, and the other article describes using C with inline assembly code to reboot. To see these articles, query on the following words:
reboot and machine and QuickC
For more information about calling C from Basic, query on the word BAS2C. For more information about calling assembly language from Basic, query on the word BAS2MASM.
Method 3
You can also call IBM ROM BIOS interrupt 19 hexadecimal (25 decimal) to reboot the computer. For example:
'Note: To use the Interrupt routine, you must load the Quick library
'QBX.QLB for Basic PDS 7.0 or 7.1 (or QB.QLB for QuickBasic 4.x) using
'the /L switch when you begin QBX.exe (or QB.exe for
'QuickBasic 4.x). When you choose the Make EXE File option from the
'Run menu, the environment will then link with QBX.LIB (or QB.LIB).
'
'The following include file must also be present:'$INCLUDE: 'QBX.BI'
' but for QuickBasic 4.x, you must instead include 'QB.BI'DIM regs AS RegType
CALL Interrupt(&H19, regs, regs) 'Reboot the computer

![]() |
Internet Explorer 6 probl...
|
Type is blue. Why?
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |