I have a folder on my Desktop named test
. I want to create a batch file in order to close the window automatically when this folder is opened with Windows Explo
This works in Windows 8.1
with explorer folder options
set to single window
but from the answer by Mofi and comments in Mofi's answer, then the solution depends on the Windows version.
What works in Windows 8.1 doesn't work in Windows XP.
TASKKILL /F /FI "WINDOWTITLE eq %userprofile%\desktop\test" /IM explorer.exe