Let XP fully automatic maintenance system! The routine maintenance of Windows XP is a time-consuming and boring thing. If Windows XP is smarter, it's fine to do automatic maintenance. Below, we will introduce a technique for automatic maintenance of Windows XP through .inf file. The specific content of automatic maintenance can be set arbitrarily, but it needs to be implemented by commands. For example, use Xcopy for file backup, Defrag for disk defragmentation, Del to delete junk files, and so on. In order to clarify the principle, let's take Defrag as an example. You can modify it according to your needs.
Implementation Steps
1. Create the Main.bat file and log in to Windows XP as an administrator. Create a new file named Main.bat in the root directory of the system disk. Take the following) and enter the following:
cd\\ C: cd Windows\\system32 defrag C: /f chkntfs C:
2. Create the Main.inf file
Create a new file named Main.inf and type:
[version] Signature= "$CHICAGO$" AdvancedINF= 2.5,"advpack.dll" [DefaultInstall] RunPreSetupCommands=Tst.PreSetup RunPostSetupCommands=Tst .PostSetup [Tst.PreSetup] C:\\Main.bat [Tst.PostSetup] C:\\WINDOWS\\SYSTEM32\\TSSHUTDN.EXE 0 /DELAY:0 /POWERDOWN
In this file, Signature must be set to "$CHICAGO$", otherwise the file will not work.
3.Create a Begin.bat file
Create a batch file Begin.bat in the root directory of the C drive, and type in this file:
C:\\WINDOWS\\ System32\
undll32.exe advpack.dll,LaunchINFSectionEx C:\\Main.inf,DefaultInstall,,32
The purpose of this command is to let Windows XP start a hardware installation process to execute the instructions in the .inf file. Rundll32.exe is used in Windows to call functions provided by functions in DLL files (dynamic link libraries). For example, the rundll32.exe here calls the LaunchINFSectionEx function in advpack.dll. The function of this function is to start an .inf installation process. However, the content of Main.inf has not been related to hardware installation, but has been changed to a system automatic maintenance command by us.
4, scheduled tasks
The role of the scheduled task is to periodically execute the Begin.bat file, the implementation steps are as follows:
(1) Open the Windows XP start menu to enter the program →Accessories→System Tools→Scheduled Tasks, double-click Add Scheduled Tasks, click Browse, locate the Begin.bat file under the root directory of the C drive, and click the Next button;
(2) Set the task execution period to "Weekly", and then click the "Next" button;
(3) Set the password for executing the scheduled task, that is, the administrator password of the computer, and then click " Next step button;
(4) Set the specific date and time for executing the task.
In the above example, we let the scheduled task execute the file C:\\Begin.bat at 23:30 every Sunday for automatic maintenance.
Implementation Principles
.inf files are usually used for hardware installation and are actually a text file. When the user right-clicks on the file and selects "Install", Windows will perform a series of operations based on the contents of this file. The automatic maintenance method described above is implemented by means of this feature of the .inf file.
When the scheduled task we create starts, it calls Begin.bat. Begin.bat will start a setup process using Main.inf as a
file, performing a series of operations in accordance with the contents of Main.inf.
When Main.inf starts, it will first execute the statement in the [Tst.PreSetup] section, which is called "C:\\Main.bat". When Main.bat is called, Windows will perform disk fragmentation on C: Organize your work. The richer the content of Main.bat, the more powerful the automatic maintenance function.
After the commands in Main.bat are executed, the statements in [Trs.PostSetup] will be executed again, that is:
C:\\WINDOWS\\SYSTEM32\\TSSHUTDN.EXE 0 /DELAY:0 /POWERDOWN
The purpose of this statement is to turn off the computer, which is actually "turn off Windows XP+ to turn off the power."
The last thing to note is that this method can only be implemented in Windows XP Professionl, Windows XP Home cannot be used.
VII. Auxiliary functions Auxiliary functions include some special functions, which can fulfi
Windows XP and Windows Server 2003 have a very user-friendly feature: Remote Desktop. This f
In order to improve the security of the registry, the best practice is to back up in time. Manual ba
3. Turn off the computer shortcut: Create a new shortcut on the desktop, type shutdown -s -
Retrieving the hidden components of Windows XP
Ingenious Chinese Windows XP/2003 Disk Utility
How does IE6 make PNG pictures transparent?
Fun performance optimization of Windows XP registry
Extremely fast Windows xp system
Windows XP operating system installation disk parameters big mystery
Check the error trap in the Windows XP SP2 system crazy BT
Win XP resource manager practical skills two
Reasons for the recovery of the system from a serious error and the solution
Teach you to identify the hidden system file authenticity
Use your Windows XP backup plan
How to set high contrast display in Windows 8 system?
How to solve the influence of u disk format on the number of file copies under Win7 Ultimate system
Some problems in Windows XP installation
Diablo 3 sells moon cakes, as long as 199 dark moon cakes take home
Vista version Plus Pack new features first look at
WP8.1 voice assistant Cortana re-disclosed, named customizable
What should I do if the files in the u disk are missing? u disk file recovery tutorial