Allow Windows XP to fully maintain the system

Source: Internet
Author: User
Tags execution administrator password root directory

The day-to-day maintenance of Windows XP is a time-consuming and tedious thing to do if Windows XP is smart enough to automate maintenance. Here, we introduce a technique for automatic maintenance of Windows XP through an. inf file, and the details of the automatic maintenance can be set arbitrarily, but require a command to implement. For example, use xcopy for file backup, defrag disk defragmentation, del Delete junk files, and so on.   To clarify the principle, let's take defrag as an example, you can make changes according to your own needs.





implementation Steps





1. Create Main.bat file





Log on to Windows XP as an administrator, create a new file named Main.bat under the root directory of the system disk (file name can be arbitrarily taken, below) and enter the following:





CD





C:





CD Windowssystem32





defrag C:/F





chkntfs C:





2. Create Main.inf file





Create a new file with a file name of Main.inf and enter:





[Version]





signature= "$CHICAGO $"





advancedinf= 2.5, "Advpack.dll"





[DefaultInstall]





Runpresetupcommands=tst.presetup





Runpostsetupcommands=tst.postsetup





[Tst.presetup]





C:main.bat





[Tst.postsetup]





C:windowssystem32tsshutdn. EXE 0/delay:0/PowerDown





in this file, signature must be set to "$CHICAGO $", otherwise the file will not function.


3. Create Begin.bat file





in the C-packing directory to establish a batch file Begin.bat, to the file input:





C:windowssystem32rundll32.exe advpack.dll,LaunchINFSectionEx





c:main.inf,defaultinstall,,32





The purpose of this command is to have Windows XP start a hardware installation process to execute instructions in the. inf file. Rundll32.exe is used in Windows to invoke functionality provided by functions in DLL files (dynamic-link libraries). For example, the rundll32.exe here calls the LaunchINFSectionEx function in Advpack.dll, which is the function of starting an. inf installation process.    However, the content of Main.inf has nothing to do with hardware installation, but we cynical changed to the system to automatically maintain the command.





4. Scheduled Tasks




The purpose of the
Schedule task is to execute the Begin.bat file on a regular basis, as follows:





(1) Open the Windows XP Start menu into the "program → accessories → system tools → scheduled Tasks", double-click "Add Scheduled Task", click "Browse", find the Begin.bat file under the C packing directory, and then click "Next" button;





(2) Set the task execution cycle to "weekly", and then click the Next button;





(3) sets the password for the execution of the scheduled task, which is the administrator password for the computer, and then clicks the Next button;





(4) sets the exact date and time the task was executed.





in the above example, we have this scheduled task to perform a file c:begin.bat every Sunday of 23:30, for automatic maintenance.





Realization Principle




The
. inf file is typically used for hardware installation, and is actually a text file.    When the user clicks on the file to select "Install", Windows will perform a series of actions based on the contents of the file, and the automatic maintenance method described above is implemented with this feature of the. inf file.





When the scheduled task we set up starts, it calls Begin.bat.    Begin.bat will use Main.inf as the configuration file to start an installation process, follow the contents of the Main.inf to perform a series of actions.





Main.inf starts with the statement in the [Tst.presetup] segment, that is, "C:main.bat", and when invoked, Windows performs disk defragmentation on C:. The richer the content of the Main.bat, the more powerful the automatic maintenance function is.




After the commands in the
Main.bat are executed, the statements in [Trs.postsetup] are executed, which is:





C:windowssystem32tsshutdn. EXE 0/delay:0/PowerDown





This statement is to turn off the computer, in fact, "Turn off Windows xp+ power off."





last but not least, this method can only be implemented in Windows XP Professionl and Windows XP Home is not available.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.