laz3boy Posted September 27, 2009 Share Posted September 27, 2009 (edited) Let's say I have a folder in drive C: named XI can open that folder from a cmd window with the command start C:\Xbut what If I want to close the same opened folder through cmd or a bat , How can I do it?? thanx in advance.. Edited September 27, 2009 by laz3boy Link to comment Share on other sites More sharing options...
Geej Posted September 27, 2009 Share Posted September 27, 2009 Try NirCmd.exe. Read the help file.To close all opened explorer folders, syntax : nircmd.exe win close class "CabinetWClass"To close only a particular folder, say My Picture folder ( I have My Pictures & My Music folders open), syntax: nircmd.exe win close title "My Pictures" Link to comment Share on other sites More sharing options...
laz3boy Posted September 29, 2009 Author Share Posted September 29, 2009 Wow!, this gets the job done man!!, thanx a lot ~~!!Its a nice little utility and it helps in many other stuffthanks again. Link to comment Share on other sites More sharing options...
tazosmr Posted May 17, 2013 Share Posted May 17, 2013 (edited) method 1 : With CMD(command prompt):TASKKILL /F /FI "WINDOWTITLE eq MYTITLEEEEEEEEEEEEEE" /IM explorer.exe(just change MYTITLEEEEEEEEEEEEEE with the opened folder's title [case-sensitive]) method 2 :open a new text document and enter this code:Set oShell = CreateObject("WScript.Shell")If oShell.AppActivate("YourWindowTITLEEEEEEEEEEEEE") ThenWScript.Sleep 100oShell.SendKeys "%{F4}"End Ifthen save that file as yourfile.vbs and put to your desired path.Then run the Command:%windir%\system32\cmd.exe /C "START /WAIT CScript C:\ExampleFolder\yourfile.vbs //NoLogo" (note,that you should change "YourWindowTITLEEE" and "yourFileName.vbs" to whatever you want. Below is just an Edited July 11, 2014 by tazosmr Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted July 11, 2014 Share Posted July 11, 2014 Thank you for answering a 5 year old post. Link to comment Share on other sites More sharing options...
Softkiller Posted August 9, 2015 Share Posted August 9, 2015 Metod1Metod2 Don't work Something Else maybe. Can't close folder Libraries in win7 Link to comment Share on other sites More sharing options...
jaclaz Posted August 9, 2015 Share Posted August 9, 2015 Metod1Metod2 Don't work Something Else maybe. Can't close folder Libraries in win7Which "Title" are you using for it?DId you try the nircmd.exe? jaclaz Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now