* Clearing the FH Recent Files list

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Clearing the FH Recent Files list

Post by Mark1834 »

This is a follow-on from discussion on Clearing the list of recent files from the FH File>Gedcom File Tasks menu. I've created a new thread so that we can separate out discussing the topic in general from advice given to a specific question.

The current KB advice (which dates from the very early days of FH) is to download a separate exe utility file. Many users do not like downloading additional software, and IMO this is not the preferred option today as it has been made more complex due to enhanced antivirus security protection against potential malware.

There are two alternatives on offer. The user who is comfortable with operating at the command line and modifying the Registry directly can simply enter the following Windows command. FH must not be open at the time, as external changes to the Registry are overwritten when the program closes.

Code: Select all

reg delete "HKCU\SOFTWARE\Calico Pie\Family Historian\Recent File List"
The general user can simply download and run the attached very short plugin, which closes FH automatically (after ensuring that the current project has been saved and confirmation obtained from the user) and deletes the list. IMO, this is preferred to downloading an exe file, and is simpler for the inexperienced user, as downloading and running plugins is a core FH skill.

The plugin probably won't get that many downloads, as such housekeeping isn't required very often, but there is at least a choice of methods available now according to your personal preferences, rather than "one size fits all".

Incidentally, there appears to be an odd bug with the list that I will report to CP. Even though it is listed under "Gedcom File Tasks", it includes both Projects and standalone GEDCOM files without distinguishing between the two. Sometimes, a Project name can appear with an abbreviated full path, rather than a simple Project name, as in the screengrab.
The attachment Recent File Menu.png is no longer available
The plugin is attached. If it has disappeared, it will have been replaced by an updated version later in the thread.

Edit: Plugin file replaced with later version. I copied the description from another plugin and forgot to change all the fields!
Attachments
Recent File Menu.png
Recent File Menu.png (18.26 KiB) Viewed 2544 times
Last edited by Mark1834 on 27 May 2022 12:35, edited 1 time in total.
Mark Draper
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Clearing the FH Recent Files list

Post by tatewise »

In that other thread, the OP eventually clarified that only some of the entries listed needed to be cleared.
The entries needing to be cleared referred to non-existent GEDCOM files.
The other entries needed to be retained as the OP was working with them.
Could this new plugin offer the option to selectively clear a subset of the entries?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Clearing the FH Recent Files list

Post by Mark1834 »

That was my first thought, as the original question was “how do I delete the non-existent files?”, not “how do I delete the entire list?”

I played with that, but Windows cannot delete individual values from the list, even in regedit. That makes sense, as “file2” is no longer “file2” if “file1” is deleted!

It is possible to delete the entire list, then recreate it using only existing files, but I decided that adds too much complexity, as the list gets repopulated automatically as users open the files they are actively working on.
Mark Draper
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Clearing the FH Recent Files list

Post by tatewise »

You can update File1 to say File4 with new values of the entries to keep, and then delete File9 to File5.
I can do that in RegEdit, so should be possible via a Powershell script.

I got the impression that Jean would find it difficult to repopulate an empty list because she would have to navigate using File Explorer to discover where the GEDCOM files exist.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Clearing the FH Recent Files list

Post by Mark1834 »

Personally, I don't think it is worth the extra complexity just to give a neat and tidy list (and would be ignoring the Windows caution messages about potential system instability). However, plugins are open source. If you feel strongly about it, I wouldn't be the slightest bit offended if you developed your own complex fork (and maintained it in perpetuity of course...) ;)
Mark Draper
User avatar
ADC65
Superstar
Posts: 457
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Clearing the FH Recent Files list

Post by ADC65 »

Thanks for the Registry key solution Mark, worked for me. That list of long-deleted files in the drop-down has been irritating me for a very long time! (I wasn't aware of the .exe.) I don't need the plug-in but I'm happy to test it if you need it tested. Cheers.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Clearing the FH Recent Files list

Post by Mark1834 »

CP have responded on the odd presentation in the Recent Files list. Apparently the list is generated by a standard Microsoft function that they can't do very much about, although they will try to tweak the way it is presented in a future update.

There's definitely something weird going on inside the Microsoft control - I've tested it with a very short filename, D:\FH\Project 1.ged, and that appears in the list as D:\FH\...\Project 1.ged, which is both wrong and longer!

RM8 has the edge here - they use a bespoke recent file list, and if a file no longer exists, it is erased from the list when selected.
Mark Draper
User avatar
AdrianBruce
Megastar
Posts: 2090
Joined: 09 Aug 2003 21:02
Family Historian: V7
Location: South Cheshire
Contact:

Re: Clearing the FH Recent Files list

Post by AdrianBruce »

As an incidental, I managed to shoot myself in the foot over your plug-in, Mark. :o I wasn't going to bother clearing out my MRU list until I looked at it and my "tidy it" impulse took over. I ran it - and nothing happened except that the .BAT file got displayed. It didn't even close down FH.

Eventually it twigged that a long time ago, I'd altered the default app for .BAT files to be Notepad (or its equivalent) on the basis that I was more likely to want to view a .BAT file than run it. (I always view it first and I felt it safer to make it so that I had to explicitly run .BAT files) So all it was doing was feeding the .BAT file into Notepad, instead of running it. Sigh...

So I just opened a command window and ran the reg delete...
Adrian
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Clearing the FH Recent Files list

Post by Mark1834 »

Curious - it appears that what was fairly straightforward "a long time ago" has been made a lot more difficult in current Windows. Now that this is managed through Settings rather than Control Panel in Win 10/11, only a very limited number of "Microsoft-approved" options are available, even when running as the built-in Administrator account. As far as I can tell, the only ways to associate batch files with Notepad now are via the Group Policy Editor or a Registry hack, and that will deter all bar the most determined user from making the change (which was presumably Microsoft's intention).
Mark Draper
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Clearing the FH Recent Files list

Post by tatewise »

Yes, it seems that the right-click Open with... option has been removed from certain file types!
It used to be available for all file types.

It also was possible via Start > Settings > Apps > Default apps > Choose default applications by file type but not any more for those file types!
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
AdrianBruce
Megastar
Posts: 2090
Joined: 09 Aug 2003 21:02
Family Historian: V7
Location: South Cheshire
Contact:

Re: Clearing the FH Recent Files list

Post by AdrianBruce »

(I've deleted my last two posts on this topic just in case anyone read them - a bit too disorganised)
Mark - I have no idea how I managed to associate .BAT with Notepad. It's tricky enough with "ordinary" file types but I couldn't see how to repeat the process for .BAT files just now. Certainly I didn't do it via GPE and I don't remember running any Registry edit but who knows... :?

If I managed to mess up your routine, then that suggests to me that there could be other potential issues elsewhere. I have therefore reverted the association by (and I hope this doesn't have any gotchas):
  • Open a Command Prompt as an admin;
  • Run the command
    assoc .bat=batfile
  • And if you've been really "thorough" like me, also
    assoc .cmd=batfile
This still leaves me the ability to Open with Notepad in the right click Context menu. Whether or not I have the original icon or filetype name, I don't know. I feel that associating BAT files with Notepad may have been too clever by half...
Adrian
User avatar
Jane
Site Admin
Posts: 8508
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Clearing the FH Recent Files list

Post by Jane »

Sorry, slightly off topic, but if you want an easy way to view code, you can install the current Power Toys release from Microsoft and then use the preview pane in Windows File Explorer to view any code including .Bat in the pane.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
User avatar
tatewise
Megastar
Posts: 28341
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Clearing the FH Recent Files list

Post by tatewise »

Adrian, did you see my post in reply to your deleted posts.
Like you, I'm sure all files once had a right-click Open with... option and the default app changed in the Settings but no more.

If I need to look at a .BAT file or other files, then right-click Edit or Send to > Notepad usually works.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
jimlad68
Megastar
Posts: 921
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Re: Clearing the FH Recent Files list

Post by jimlad68 »

to open any file in most programs I just use Windows file explorer "SendTo", although it is an extra click.

for me it is located at C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\SendTo

I also include a shortcut to the SendTo folder in the SendTo folder, making it easy to add new program shortcuts.
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68
User avatar
AdrianBruce
Megastar
Posts: 2090
Joined: 09 Aug 2003 21:02
Family Historian: V7
Location: South Cheshire
Contact:

Re: Clearing the FH Recent Files list

Post by AdrianBruce »

tatewise wrote: 01 Jun 2022 16:24 ... Like you, I'm sure all files once had a right-click Open with... option and the default app changed in the Settings but no more.
I'm glad it's not just me then. But if I changed anything (and I clearly did) it's so far back that I can't be certain.
tatewise wrote: 01 Jun 2022 16:24 If I need to look at a .BAT file or other files, then right-click Edit or Send to > Notepad usually works.
Yes - the right-click options do seem a bit all over the place though. But that might be the result of me trying to make stuff more useful. (Or so I thought)
Adrian
User avatar
AdrianBruce
Megastar
Posts: 2090
Joined: 09 Aug 2003 21:02
Family Historian: V7
Location: South Cheshire
Contact:

Re: Clearing the FH Recent Files list

Post by AdrianBruce »

jimlad68 wrote: 01 Jun 2022 16:46 to open any file in most programs I just use Windows file explorer "SendTo", ...
Oh yes! I remember reading that once (it may have been a Woody tip) and probably setting it up, but suspect that it was several machines ago. I've just added Notepad++ to that SendTo folder and that seems to work a charm on everything without messing. I don't mind the extra click - I just have to remember that it's there!

Thanks very much Jim
Adrian
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Clearing the FH Recent Files list

Post by Mark1834 »

For me, it's Notepad++ every time for doing just about anything with text files. Virtually any text file has a right-click "Edit with Notepad++" option, and it understands every scripting language I've heard of (plus many I haven't!), so automatically displays in context-sensitive syntax.

You can also associate any file extension you like with the program from its preferences menu (including those that Windows now discourages, such as .bat). I have changed the default app for .fh_lua, so whenever I double-click on a plugin file, it doesn't install itself, but opens in Notepad++ to give a display that's far superior to that of the rather primitive FH editor.
Mark Draper
User avatar
Mark1834
Megastar
Posts: 2458
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: Clearing the FH Recent Files list

Post by Mark1834 »

Following on from recent discussions on removing as many long-term useful plugins as possible from FHUG hosting, the Delete Recent File List plugin is now available from the Plugin Store.

The FHUG version earlier in this thread has now been deleted.
Mark Draper
Post Reply