Jump to content

erase recent documents folder

Recommended Posts

I would like to write a script that I can put in startup folder that will erase the recent documents folder each time Windows starts. But, I can not find out where the folder with the recent documents list is. Does anyone know where it is?

EDIT: I found the following batch file on the web at http://jeffwalso.tripod.com/batch.htm

cd ..

cd recent

echo y| del *.*

This seems to work as a batch file. I will try to use it in startup folder, but first I have to re-install my system. I tried a shareware program that is messing things up and does not want to un-install.

EDIT2: Made shortcut to batch file and added to startup folder. This runs at startup but does not clear file. Apparently the batch file must be run after Windows starts.

Edited by peter1234
Link to post
Share on other sites

You can access the path to your recent docs as:

$var = @UserProfileDir & "\Recent"

Look at the following in the help file to make a script for doing what you want:



[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to post
Share on other sites


Thanks. This works:

;deletes files in the Windows Recent Documents folder 

#include <GUIConstants.au3>
$var = @UserProfileDir & "\Recent"
$search = FileFindFirstFile("*.*")  
If $search = -1 Then Exit
While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop

I added compiled version to program files folder and put a shortcut in the startup folder.

Link to post
Share on other sites

And if you also want to cleanup the recent Microsoft Office stuff

@UserProfileDir\Application Data\Microsoft\Office\Recent

Office keeps an incredible number of files in there. Very annoying, especially in roaming profiles.

You also probably find that cleaning recent at logoff or shutdown is more effective.

Use the group policy to set this


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...