Sometimes you like Windows to do something everytime during its startup or shutdown. An example is to delete the contents inside a folder. These can be files that you do not need for the next startup.
First you need to create the script that would tell Windows which folder to delete. Then you would go to Group Policy and tell Windows to run this script at shutdown as what will be shown here.
Here is the script written as a batch file.
c:
cd cd c:\windows\prefetch
del *.* /q
cd C:\”Documents and Settings”\user\Desktop\temp
del *.* /q/f/s
cd rd C:\”Documents and Settings”\user\Desktop\temp /q/f/
cd cd c:\windows\prefetch
del *.* /q
cd C:\”Documents and Settings”\user\Desktop\temp
del *.* /q/f/s
cd rd C:\”Documents and Settings”\user\Desktop\temp /q/f/
Save this file as a plain .txt file. As you can see, this script will delete the contents inside the prefetch folder and a folder on the desktop called temp.
Now go to GP and tell it to run this script at shutdown. Type gpedit.msc in the Run command. Navigate to the appropriate location as seen in the picture.

No comments:
Post a Comment