Results 1 to 11 of 11
  1. #1
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Deleting Files by date (XP Pro (SP1))

    Is there any way to create a batch file that will delete all shortcuts in a folder that are older than 1 week? I was reading in "Windows XP Annoyances" by David Karp that Windows XP keeps creating shortcuts and putting then in Recent Documents. Apparently . while Windows will only show you the most recent 15 shortcuts (by default) there is no limit to the number of shortcuts it will store. What I'd really like to be able to do is to show shortcuts to particular file types and delete all the rest. Is this possible? Does anyone have any ideas how this might be done?

    Thanks,

    Chris (Hunt)

  2. #2
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Deleting Files by date (XP Pro (SP1))

    Can you point us to the article you were reading, Chris? It sounds like you're talking about Windows MRUs (most recently used lists) rather than shortcuts.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deleting Files by date (XP Pro (SP1))

    Hi Big Al, sorry for not being clear. It's page 119 in the book Windows Annoyances and yes, it is the Recent Documents folder. I was thinking of the shortcuts to files that Windows creates every time a document is opened. Windows shows 15 by default but David Karp says it's possible to edit a key in the registry to change the number shown. I'm not particularly interested in changing the number of files shown, but I'd like to clear out certain file types and leave others.

    Chris


    PS For those interested here is a description of how to change the default number of documents shown, taken from Computer NetWork Windows magazine:
    http://www.winnetmag.com/Article/Art...980/23980.html

    1. Start a registry editor (e.g., regedit.exe).
    2. Navigate to HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVe rsionPoliciesExplorer.
    3. From the Edit menu, select New - DWORD value.
    4. Enter a name of MaxRecentDocs, and press Enter.
    5. Double-click the new value, and set the base to Decimal.
    6. Set this value to the number of documents that you want Windows to display (in multiples of 15), and click OK.
    7. Close the registry editor.

  4. #4
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deleting Files by date (XP Pro (SP1))

    I can't find a way of deleting files by date. I decided that I could at least thin out the recent files folder by deleting all shortcuts that I didn't want to show up. So I made a batch file that made a temporary directory, copied across the shortcut types I wanted to have access to, cleaned out the recent files folder and then copied the shortcuts back.. The only problem is after running the bat file when I select document from the Start menu it shows as completely empty. But if I navigate to the folder via windows explorer it contains the shortcuts! How can this be? It seems that there's no way to control what gets shown in the recent documents folder at all.

    Chris

  5. #5
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Deleting Files by date (XP Pro (SP1))

    There are several programs with names like DELOLD or DELOLDER which could be Googled for, and I (re-)wrote something ages back to use the NT4 Resource Kit's "FORFILES" program, attached...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  6. #6
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deleting Files by date (XP Pro (SP1))

    Thanks John,

    I googled DELOLD and found this link:http:// http://www.savilltech.com/delold/ . But I couldn't figure out how to run it from the command line. Neither did I really understand the file that you kindly attached. My programming skills are extremely limited. I guess I'll just stick with clearing the recent documents folder out by hand. Still not sure why when I use my bat file the start menu shows up empty but there are links in the folder.

    All the best,

    Chris

  7. #7
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Deleting Files by date (XP Pro (SP1))

    Chris

    Using John Savill's DELOLD from the command line is quite straightforward. Once you've installed it, try something like

    delold /c /n:12 "crogram filessomedirectory*.ext"

    to delete files with the extension "ext" in that path which are older than 12 days.

    If you don't want DELOLD to ask whether you really, really, want to delete the files change the option to /-c. Possibly add /q to reduce the number of messages.

    If you have any more trouble, please specify the directory/folder from which you want to delete the files, giving examples of the filenames, and I'll construct something that might do the job!

    John

    PS If you're referring to the folder/directory "Cocuments and Settings<userid>Recent", which can show up in Windows Explorer as "My Recent Documents", then you won't be able to see this unless you go to Tools => Folder Options => View, and turn ON the option "Show hidden files and folders" and turn OFF the option "Hide protected operating system files (Recommended)".
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  8. #8
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deleting Files by date (XP Pro (SP1))

    Thanks John,, your offer is very kind.

    I tried using the example you gave me.. I modified it and tried it in the run box. Windows gave me a message saying that it couldn't find delold. Where should delold be? I have an exe file that runs when I doubleclick it but doesn't seem to have installed a program.

    My immediate goal is to be able to clear out the recent folder and have it show only particular extensions. I made a batch file that works as follows:

    ----------------------------------

    @echo off
    rem this tidies up the recent folder
    echo.

    mkdir "c:tidy"

    copy /y "Cocuments and SettingsusernameRecent*.doc.*" "c:tidy"
    copy /y "Cocuments and SettingsusernameRecent*.acd.*" "c:tidy"
    copy /y "Cocuments and SettingsusernameRecent*.cdr.*" "c:tidy"
    copy /y "Cocuments and SettingsusernameRecent*.cpt.*" "c:tidy"
    copy /y "Cocuments and SettingsusernameRecent*.txt.*" "c:tidy"

    del "Cocuments and SettingsusernameRecent*.*"/f/q

    copy /y "c:tidy*.*" "Cocuments and SettingsusernameRecent"

    del "C:tidy*.*"/f/q

    rmdir "c:tidy"

    ----------------------------------

    It took me a while to figure out how to copy the lnk files. I used copy because I never seem to be able to get move to work. This bat file allows me to keep the lnk files I want but doesn't remove old files. I'd like to get rid of anything older than a week. The other problem is that after running this bat file I can see nothing via Start > Documents. The folder looks completely empty. But if I navigate to it, it contains the shortcuts that were copied back. I'm probably going about this cack-handed. Any suggestions would be appreciated.

    Chris

  9. #9
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Deleting Files by date (XP Pro (SP1))

    If you're running DELOLD using the Start => Run method (or, in fact, any method at all!) then DELOLD.EXE needs to be in whatever PATH is current. If you wanted you could stick it in either C:WINDOWS or C:WINDOWSSYSTEM32, for example.
    Or set up a small BATch file to change directory to wherever you installed DELOLD, then have a command line to run it.

    MOVE has always been a pig to use and it is full of anomalies, so the COPY/DEL method is often better!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  10. #10
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Hatsukaichi, Hiroshima, Japan
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deleting Files by date (XP Pro (SP1))

    Thanks John, it worked! I moved the location of DELOLD to c:windows and added the /q switch together with the /-c switch to get it to run automatically in the background. I added the command to the beginning of my batch file. I can clear out all the old shortcuts and get rid of the type I don't want completely. The only problem is that I'm still not seeing the shortcuts. Perhaps moving them back out and moving them back in upsets Windows. I'm going to have another go at making a batch file. This time only using DELOLD to get rid of all the shortcuts I don't want. Perhaps this will work better.

    DELOLD is a great find, thanks for letting me know about it. I'd searched various terms but hadn't come across it. I can think of various uses for it..

    Best wishes,

    Chris

  11. #11
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Deleting Files by date (XP Pro (SP1))

    Glad to have been of service, kind sir!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •