I try to close a folder by its path using SHDocVw
. It's not working:
Acces deined.
I run my program as an administrator.
ShellWindows _shellWindows = new SHDocVw.ShellWindows();
string processType;
foreach (InternetExplorer ie in _shellWindows)
{
processType = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
if (processType.Equals("explorer") && ie.LocationURL.Contains(mypath))
{
ie.Quit();
}
}