Remove Recent Places from Windows 7 Favorites using Batch or Registry?

0

How do you remove the Recent Places shortcut from the Favorites side bar in Windows 7 using a batch file or from the registry? For example, when running a batch file to configure, add, and remove various aspects of Windows 7 after a fresh install of the OS?

I've tried DEL and RMDIR with no luck from %USERPROFILE%/Favorites, %USERPROFILE%/Links, and even %APPDATA%/Microsoft/Windows.

Little Catman

Posted 2014-12-29T01:42:16.230

Reputation: 1

Answers

0

Despite being shown as "Recent Places" in the folder, and in its properties, checking the directory in command prompt reveals it's not "Recent Places.lnk" but rather "RecentPlaces.lnk"

That said, my solution was to include this in a batch:

DEL /Q "%USERPROFILE%\Links\RecentPlaces.lnk"

This deletes the folder, and the /Q attribute does it quietly so there is no need to confirm that it is okay to delete it.

Little Catman

Posted 2014-12-29T01:42:16.230

Reputation: 1

0

Check to see if the files/locations that you are looking for are stored in the "C:\Users\%UserName%\AppData\Roaming\Microsoft\Windows\Recent Items" folder. This might be what you're looking for. It will contain shortcuts to network mappings, folders etc.

If you would like to remove the recent items altogether you can remove it by creating a regkey and calling it from a batch file:

Create a file called disable-recent-items.reg and place the contents below into it.

Windows Registry Editor Version 5.0

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] "NoRecentDocsHistory"=dword:00000001

Optichip

Posted 2014-12-29T01:42:16.230

Reputation: 649

The folder itself is empty, but it's that folder itself that I would like to remove. If the folder itself can't be removed (which seems likely, seeing as it doesn't have a remove / delete option), I'd like to at least remove the shortcut to it from the Favorites bar as part of the batch file or registry tweak. – Little Catman – 2014-12-29T02:03:11.497

You can do a reg entry that disables it if you don't want it to be used. You can do this by creating a .reg file and calling it from your batch file. – Optichip – 2014-12-29T02:18:31.673

This doesn't seem to be working for me. I've run it through my batch, from the .reg being run by my batch directly, and by making a new .reg file and running that (had to change 5.0 to 5.00 for some reason to get it to run, but it ran) and nothing's happened in regards to the Recent Places sidebar shortcut. – Little Catman – 2014-12-29T02:35:19.893

Is it storing any recent locations or files in it? Also might require a reboot after applying the reg. – Optichip – 2014-12-29T02:39:57.297

It is completely empty. Also, I've tried manually modifying the registry value to 1, and even restarting afterwards, and the Recent Places icon persists on my sidebar in the Favorites section. – Little Catman – 2014-12-29T02:41:38.583

I don't think you can completely hide it, I've looked for registry keys to do it but have found nothing to "hide" the folder itself. – Optichip – 2014-12-29T02:58:30.780

I know that it can be removed from Favorites manually by right clicking it and selecting "Remove." This can also be done from %USERPROFILE%/Links which does the same thing. I believe this is why I can't use a batch file to DEL or RMDIR the folder away. Is there maybe a command for removing rather than deleting? – Little Catman – 2014-12-29T03:02:14.250