Summary of the invention
The invention provides a kind of automatic reboot test method,, can also check in the computer system whether normal operation of memory storage by this except carrying out automatic reboot.
The present invention proposes a kind of automatic reboot test method, is suitable for an operating system.This automatic reboot test method comprises the following steps: to set one and reopens the machine number of times.Choose the memory storage in the computer system, wherein this memory storage comprise read-only memory storage and non-read-only memory storage one of them.Activate one and reopen the machine test procedure.Check that whether a count value is greater than the machine of reopening number of times.Not when reopening the machine number of times, check whether memory storage is normal if check out count value, producing a check result, and be recorded in a text file.Count value is added 1, and get back to the step that activates reopening machine test procedure.If check out when count value is non-read-only memory storage greater than this reopenings machine number of times and memory storage, delete the temporary disk that is produced in the reopening machine test procedure.Show a test result.
In an embodiment of the present invention, the step of above-mentioned memory storage in choosing computer system comprises: judge whether to choose memory storages all in the computer system.If judged result, then enters the step of activation reopening machine test procedure for being.If judged result is then chosen the memory storage of desiring to check for not, and enter the step that activates this reopening machine test procedure.
In an embodiment of the present invention, above-mentionedly before the step of the state of checking memory storage, also comprise: judge whether to stop reopening machine test procedure.Stop reopening machine test procedure if judge, then count value is adjusted into reopening machine number of times.If judge and do not stop reopening machine test procedure, then enter and check whether normally step of memory storage.
In an embodiment of the present invention, the initial value of above-mentioned count value can be 0.
In an embodiment of the present invention, above-mentioned check result comprise supervision time and memory storage be normal condition and up-set condition one of them.
From another viewpoint, the present invention proposes a kind of automatic reboot test method, is suitable for an operating system.This automatic reboot test method comprises the following steps: to set one and reopens the machine number of times.Activate one and reopen the machine test procedure.Check that whether a count value is greater than the machine of reopening number of times.If when checking out count value not greater than the machine of reopening number of times, check whether the memory storage in the computer system is normal, producing a check result, and be recorded in a text file, wherein memory storage comprise read-only memory storage and non-read-only memory storage one of them.Count value is added 1, and get back to the step that activates reopening machine test procedure.If check out when count value is non-read-only memory storage greater than this reopenings machine number of times and memory storage, delete the temporary disk that is produced in the reopening machine test procedure.Show a test result.
In an embodiment of the present invention, whether above-mentioned memory storage in checking computer system more comprises before the step normally: judge whether to stop reopening machine test procedure.Stop reopening machine test procedure if judge, then count value is adjusted into reopening machine number of times.If judge and do not stop reopening machine test procedure, then enter whether normal step of the memory storage checked in the computer system.
In an embodiment of the present invention, the initial value of above-mentioned count value is 0.
In an embodiment of the present invention, above-mentioned check result comprise the state of the memory storage in supervision time and the computer system be normal condition and up-set condition one of them.
The present invention is by a computer program, except can automatically performing the reopening machine, and can check the operating state of the memory storage in the computer system.In addition, the check result of above-mentioned memory storage can be recorded in the text file, so that allow the user learn the state of computer system, check result is analyzed, with problem analysis place effectively (for example be memory storage takes place unusual).
For above and other objects of the present invention, feature and advantage can be become apparent, preferred embodiment cited below particularly, and conjunction with figs. are described in detail below.
Embodiment
Below will propose embodiment, and come to be illustrated, in the hope of tool common knowledge in this area being looked for more can understand the present invention and can implementing according to this at the present invention.Certainly, the form that following embodiment can also computer program realizes it, and utilizes computer readable memory medium to store this computer program, carries out following method in order to computer system.In the present embodiment, above-mentioned computer program for example use one can be cross-platform program language (for example VBScript language, but do not limit its scope) design so that can be applicable to operating system (the Operating System of different editions, OS) on, and then overcome compatible problem.
Fig. 1 illustrates the process flow diagram according to the automatic reboot test method of one embodiment of the invention.The automatic reboot test method that present embodiment provided is applicable to an operating system, for example for Microsoft be Windows (Windows OS).Please refer to Fig. 1, at first, in step S102, set one and reopen the machine number of times.That is to say that the user can import reopening machine number of times in advance when the reopening machine is tested, for example 5 times, 10 times, 50 times or 200 times, but do not limit its scope, make computer system be accomplished the number of times that the user imports the reopening machine.
Behind input reopening machine number of times, the user can be further as described in the step S104, choose the memory storage (not illustrating) in the computer system (not illustrating).That is to say that the selected memory storage of getting can be when computer system be carried out reopening machine (operating system activates again) each time, the action of testing.In the present embodiment, memory storage can comprise read-only memory storage and non-read-only memory storage one of them.But not read-only memory storage for example is hard disk or the network hard disc that computer system disposed.In addition, read-only memory storage for example be CD-ROM and DVD-ROM one of them.In addition, when the user choose CD-ROM and DVD-ROM one of them the time, computer program can remind the user to put into CD or DVD, so that carry out follow-up test process.
Afterwards, when reopen machine number of times and memory storage choose finish after, can carry out step S106, be exactly formally to activate reopening machine test procedure.Can activate automatically by computer program and activate reopening machine test procedure.
Then, in step S108, whether check a count value greater than the machine of reopening number of times, wherein the original state of count value is 0.That is to say that computer system can utilize computer program to check that whether count value is greater than the machine of reopening number of times.
If check result is found count value not greater than the machine of reopening number of times, then, check whether memory storage is normal as described in the step S110, producing a check result, and this check result is recorded in a text file.In the present embodiment, check result comprise supervision time and memory storage be normal or undesired one of them.That is to say, if memory storage is normal (Pass) state, then in text file the record check result of institute for example be " " 2007.09.1010:09:50a.m. "; " P " " wherein, " 2007.09.1010:09:50a.m. " represents the supervision time, and be respectively year, month, day, hour, min, second, a.m./p.m.), P represents that check result is normal (Pass).In other words, if memory storage is undesired (Fail) state, then the record check result of institute for example is " " 2007.09.1010:19:50p.m. ", " F " " in text file, and wherein F represents that check result is undesired (Fail).
Because memory storage comprises read-only memory storage and non-read-only memory storage.Therefore, in the present embodiment,, for example when hard disk or network hard disc, then for example can utilize the built-in Notepad.exe program in Windows the inside when being checked through non-read-only memory storage, and with Notepad.exe program copy (Copy) in a temporary disk.On the other hand, computer program also can copy to the data of memory storage in the above-mentioned temporary disk, to carry out the file comparison.Wherein, the mode of comparison is for example compared the size of file position.If comparison result is normal, the running of expression memory storage is normal.Otherwise, if by the memory storage reproducer to temporary disk time failure or comparison result undesired, represent that memory storage has problem.
In addition, when checking read-only memory storage, for example CD-ROM or DVD-ROM, but do not limit its scope, user for example can carry out DIR program (that is can browse among CD-ROM or the DVD-ROM data).If execution result is normal, represent that the running of read-only memory storage is normal, that is CD-ROM or DVD-ROM can read the data content in CD or the DVD.In other words,, represent that read-only memory storage is unusual if can't the DIR execution result, that is CD-ROM or DVD-ROM reads less than the data in CD or the DVD.In addition,, also can carry out the result of DIR, therefore can check out that also read-only memory storage is an abnormal results if CD-ROM or DVD-ROM do not have when placing CD or DVD.
After checking out memory storage, then enter step S112, count value is added 1, and get back to step S106, reopen the action of machine test procedure with sustained activation, up in step S108, when computer program is checked out count value greater than the machine of reopening number of times, just can stop to reopen the process of machine test procedure.
In order more clearly to describe each step of above-mentioned automatic reboot test method, below the detailed process of automatic reboot test method of the present invention is described for an embodiment again.Fig. 2 illustrates the automatic reboot test method process flow diagram according to another embodiment of the present invention.Please refer to Fig. 2, at first, in step S202, set one and reopen the machine number of times.That is to say that the setting computer system reopens the number of times of machine.
Then, in step S204, judge whether to choose memory storages all in the computer system.For instance, can demonstrate a window on the operating system, so that allow the user determine whether choose all memory storages.If the user determines to choose all memory storages, or computer program is not in not response of a period of time discovery (that is the user has to respond), and then computer program can be judged and choose all memory storages.Computer system afterwards, just directly enters among the step S208, activates reopening machine test procedure, so that can be checked above-mentioned selected memory storage in the process of the machine of reopening.
In other words,, then can in the window of operating system, select cancellation to choose all memory storages, make computer program judge and do not choose all memory storages if when the user does not want to test all memory storages.Afterwards, in step S206, choose the memory storage of desiring to check.That is to say that the visual demand of user is chosen the specific memory device, to carry out the process of subsequent examination.In addition, no matter be in step S204 or step S206, if choose read-only memory storage, that is when CD-ROM or DVD-ROM, computer program still can remind the user need insert CD or DVD.
Afterwards, when reopen machine number of times and memory storage choose finish after, can carry out step S208, be exactly formally to activate reopening machine test procedure.Can activate automatically by operating system and activate reopening machine test procedure.
Then, in step S210, whether check count value greater than the machine of reopening number of times, wherein the original state of count value is 0.That is to say that computer system can utilize computer program to check that whether count value is greater than the machine of reopening number of times.
If check result is found count value not greater than the machine of reopening number of times, then, judge whether to stop reopening machine test procedure as described in the step S212.In this step S212, computer program can be reserved a period of time, and for example 10 seconds, and wait for whether the user determines terminator.
If judged result is for stopping reopening machine test procedure (that is the user determines to stop reopening machine test procedure), then execution in step S214 is adjusted into reopening machine number of times with count value.For instance, at this moment,, be 200 o'clock and reopen the machine number of times if count value is 5, then directly count value is adjusted into 200 by 5, so that after subsequent step executes, stopped reopening machine test procedure.After count value being adjusted into reopening machine number of times, can advance as step S216, check just whether memory storage is normal, producing a check result, and be recorded in a text file.
Hold above-mentioned, if judged result for do not end reopening machine test procedure (for example be computer program through 10 seconds counting after, find that the user there is no response), then directly enter step S216, check just whether memory storage is normal, producing a check result, and be recorded in a text file.And in step S216, the process of inspection memory storage and the step S110 of Fig. 1 embodiment are same or similar, so repeat no more.
Then, in step S218, count value is added 1, and get back to step S208,, proceed the test process of memory storage so that activate reopening machine test procedure once more.
In addition, behind execution in step S210, if judge count value when reopening the machine number of times, then as described in the step S220, the temporary disk in the deletion reopening machine test procedure.For instance, when being checked through non-read-only memory storage, can xcopy to a temporary disk, whether normal to check non-read-only memory storage.Therefore, in step S220, above-mentioned temporary disk can be deleted.Afterwards, in step S222, show test results.That is to say that this test result can demonstrate all check results that write down when reopening machine each time, for example show with an inventory, so as to allow the user from then on test result just can learn check result and problem analysis place.
In sum, the present invention is by a computer program, except can automatically performing the reopening machine, and can check the operating state of the memory storage in the computer system in the lump.In addition, the check result of above-mentioned memory storage can be recorded in the text file, so that allow the user learn that computer system carries out the state of reopening machine test, and check result is analyzed, with problem analysis place effectively (for example be memory storage takes place unusual).In addition, computer program of the present invention be to use one can be cross-platform program language, make automatic reboot test method can be used for the operating system of new and old edition, thus, can overcome compatible problem effectively.
Though the present invention discloses as above with preferred embodiment; right its is not in order to limiting the present invention, anyly has the knack of this skill person, without departing from the spirit and scope of the present invention; when can doing a little change and retouching, so protection scope of the present invention is when with being as the criterion that claim was defined.