C# How to Not Update LastAccessTime when extracting Icon
I have a comboBox that sorts the List<(tuple)> by LastAccessTime, Basically Recently used but when Im extracting an Icon.ExtractAssociatedIcon() I know that It updates LastAccessTime and I cant suppress it. What I came up is to save the LastAccessTime into a DateTime originalLastAccessTime variable and then after I do my Icon.ExtractAssociatedIcon() I do File.SetLastAccessTime(originalLastAccessTime) and then add the originalLAT variable to the List of tuples so I can sort it later through Another ComboBox by Recently used.
But I get UnauthorizedAccessException because some files directories need Privileges AKA: run as Admin. How can I make it work I dont mind if the user doesnt get all the Apps listed in the ComboBox and when he runs as Admin he gets them.
I tried using Try-Catch statement but Ive heard its slow and im not satisfied if anyone can help how I can make it better or if there is a better way to sort by Recently Used or Extract the Icon from an .exe without updating LastAccessTime i would be really grateful.