Refresh Explorer folder view

I made an app that will get a version of a file. This is done thru an RCM on the file and dispatch runs the app. After doing the GetFileCopy with the version it still shows the old version of the file in Explorer, uses have to click off and back on the file to see the version they got. I thought using RefreshFolder would show the updated info, but it does not work how I thought it should. Am I using it wrong? If this is not the right call, does anyone know one that would work?

var file = vault.GetFileFromPath(filePath, out var folder);
file.GetFileCopy(0, version);
vault.RefreshFolder(folder.LocalPath);

The answer is right there. You need to specify the parent window handle correctly GetFileCopy.

Is your code being called from an add-in?

Based on your comment, get the console application’s handle using the Process class from Diagnostics. Details here: Process.MainWindowHandle Property (System.Diagnostics) | Microsoft Learn

You need to make sure you log into the vault using that handle!