REM *** inside autoexec.bat *** cd C:\temp del *.tmp
Each time when the system reboots, those files with extension tmp will be removed in the temp folder of C: drive.
How to do this in Windows Vista? The autoexec.bat concept is not used in Vista. However, we can tell Vista to do this by specifying a Local Group Policy on the script to execute during Windows startup. We can do this by using the Local Group Policy Editor.
Open the Run... Dialog Box from the Windows Start menu. Key in "gpedit.msc" to start the Local Group Policy Editor.
When the Local Group Policy Editor appears, expand on the left pane, Local Computer Policy → Computer Configuration → Windows Settings → Scripts (Startup/Shutdown).
Double click on the right pane, Startup. Click on the Add button and specify the script you want Windows to execute during startup. In this case, I placed the delete commands in a script called cleartemp.bat.
Click OK and we are done! Exit the editor. Test out the script by restarting Windows Vista.
No comments:
Post a Comment