I am manipulating JPEG images programmatically from C# in a WinForms app in Win 10 and would like File Explorer to show the manipulated rather than the original image thumbnail. Closing Explorer, deleting %LocalAppData%\Microsoft\Windows\Explorer\thumbcache_*.db and restarting does this but it is slow and intrusive. I would like to update an individual file's thumbnail programmatically. Windows does this when an image is rotated via the Explorer context menu, but the means for doing this from a program aren't clear.
The batch file which I currently use to close Explorer, delete the thumbnail cache file and restart is
taskkill /f /im explorer.exe
timeout 2 /nobreak>nul
DEL /F /S /Q /A %LocalAppData%\Microsoft\Windows\Explorer\thumbcache_*.db
timeout 2 /nobreak>nul
start "" %windir%\explorer.exe
start "" %windir%\explorer.exe "Folder To Update"