I am looking for a way to close a File explorer window programmatically using C#. I am writing an automation script and I am stuck in the scenario where I have to close a File explorer after selecting a file. Selenium doesn't work with Window-based forms. So is there a way that I can accomplish the task of closing the File Explorer window using C#.
The answer mentioned in the below link doesn't work for me. Is there a way to close a particular instance of explorer with C#?