I know most uninstallers of programs (at least since Windows 7) could delete program folder even if it opened up in Explorer. After uninstalling Explorer just refreshes and go up to Program Files folder automatically.
How to do same thing (tell explorer that folder need to be not in use) in programming language (particularly in VB.net)?
OK. So you want explorer to go to the parent folder of the current folder. If the current folder is "c:\windows\fonts", you want to change it to "c:\windows".
The following code should do this.. Have a look at the comments for an explanation of some of the code
Private Sub ChangeExplorerToParentFolderOf(currentFolder As String) Dim shellWindows As SHDocVw.ShellWindows = New SHDocVw.ShellWindows Dim filename As String Dim operationCompleted As Boolean = False currentFolder = "file:///" & currentFolder.Replace("\", "/").ToLower 'Searches all open explorer windows that are pointing to 'the currentFolder parameter and if found, navigates to 'its parent folder. ' 'if successful, sets the operationCompleted cariable to true For Each ie As SHDocVw.InternetExplorer In shellWindows filename = Path.GetFileNameWithoutExtension(ie.FullName).ToLower() If filename.Contains("explorer") And ie.LocationURL.ToString.ToLower = currentFolder Then Dim parentFolder As String = currentFolder.Remove(currentFolder.LastIndexOf("/")) ie.Navigate2(parentFolder) operationCompleted = True End If Next 'If no instance of explorer is pointing to the currentFolder (operationCompleted=false), 'show a messagebox to say so If operationCompleted = False Then MessageBox.Show("No instance of Windows Explorer exists that" & vbCrLf & "points to " & currentFolder) End If End Sub