After all, I’m a developer too, so i quickly created a smart c++ console app that does what I needed.
Not only it detects if the window is already opened but also if it is will select it to show on top instead of reopening it (handy when your previous windows is buried below other ones since last time you exported).
Now if not present, it will launch explorer of course but also wait that the window is shown (otherwise code would be sometimes unreliable when multiple files are generated at once)…
Open_Explorer-fab.zip (76.1 KB)
Works a treat and app was trivial to code, so here’s the solution for you:
Here the quick (and not so dirty) cpp console app source code too :
// Console app that launches an explorer window only if it is not already open, if it is it will show it to user as well instead of reopening.
bool FindExplorerWindowWithPath(const char* target_path)
HWND hwnd = FindWindow("CabinetWClass", nullptr);
GetWindowText(hwnd, window_title, sizeof(window_title));
if (strstr(window_title, target_path))
hwnd = FindWindowEx(nullptr, hwnd, "CabinetWClass", nullptr);
int main(int argc, char* argv)
if (argc != 2)
printf("Usage: %s path\n", argv);
char* path = argv;
if (!GetFullPathName(path, MAX_PATH, target_path, nullptr))
fprintf(stderr, "Error: %s is not a valid path.\n", path);
// Normalize input to always remove ending backslash and also being a dir
size_t l = strlen(target_path);
if (l > 1 && target_path[l - 1] == '\\') target_path[l - 1] = '\0';
fprintf(stdout, "Opening explorer window for path: %s...\n", target_path);
snprintf(command, sizeof command, "explorer \"%s\"", target_path);
if (!system(command)) fprintf(stderr, "Error: failed to run explorer for path: %s\n", target_path);
for (int i = 0; i < 20; i++)
if (FindExplorerWindowWithPath(target_path)) break;
fprintf(stderr, "Explorer window for path: %s already exists...\n", target_path);
Note: you need my new script too in the zip.