Using this answer, I can create shortcuts (.lnk files) for various executables and folders.
When I use the Recent Items directory (C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Recent) in the SHORTCUT, the PWS call creates the shortcut, but it disappears from File Explorer quickly - too quickly to register in an Open/Save dialog.
Strangely, the file still exists; I see it in the output of dir, and creating a new shortcut manually using these steps adds (2) to the file name used in the Shortcut tab of its Properties window. Similarly, creating the shortcut on the Desktop first, then copying it to the Recent Items folder, will prompt you for an overwrite. The copies disappear too, so this isn't a workaround either way.
How do I prevent the programmatic shortcuts from disappearing from the Recent Items folder?
interestingly, the first few times I went to Recent Files, I didn't see those Destination folders. Now, Recent Files is showing up as Recent, and I see those folders. Moreover, applications that normally use Recent Files in the Open/Save dialog now use Recent, and the shortcuts I created there are showing up.
– mathlete Sep 28 '23 at 19:43\Recent Itemsis just a display name that Explorer overlays for\Recent. I'm not sure if "Recent Files" is just an en-GB difference or if you're looking at a different application. Depending on how you access the folder, explorer may alter more or less of what you see – Cpt.Whale Sep 28 '23 at 20:12