Jump to content
Macro Express Forums

Closing a group of folders?


Recommended Posts

Can anyone think of a way to close all currently open Explorer/My Computer windows please? A regular item in my XP Taskbar is a 'grouped' entry, or whatever it's called. Right now, alongside its yellow folder icon, it says '14 Windows Explorer'. Some of those are open, some are minimised. I want to close all of them. Just as if I r-clicked the taskbar item and chose Close Group. I don't know of a Windows keyboard shortcut that will do it, and so far I haven't come up with a reliable way to find the taskbar entry so that i can r-click it. Recognising its yellow icon isn't going to be practicable because there are so many other items in the taskbar, including Quick Launch and system tray icons.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Here's what I've learnt (I don't use grouping personally as I have 3 monitors and separate taskbars <g>).

 

First, you can define when grouping should start, i.e. how many windows of the same type need to be open before grouping is used.

Using RegEdit (I'm assuming XP), navigate to

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

 

Create a new DWORD value named TaskbarGroupSize, and give it a value of 2. You'll need to log out and in for this to take effect, but if you now open just 2 explorer windows they'll be grouped.

 

Once you've got a group, you can right-click on the group button in your taskbar and choose Close Group. Now I'm guessing that it won't be too hard (not tha I've ever tried this) to write a macro that trawls the taskbar for buttons with the words "Windows Explorer" and issues a right-click.

Link to comment
Share on other sites

Here's what I've learnt (I don't use grouping personally as I have 3 monitors and separate taskbars <g>).

 

First, you can define when grouping should start, i.e. how many windows of the same type need to be open before grouping is used.

Using RegEdit (I'm assuming XP), navigate to

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

 

Create a new DWORD value named TaskbarGroupSize, and give it a value of 2. You'll need to log out and in for this to take effect, but if you now open just 2 explorer windows they'll be grouped.

 

Once you've got a group, you can right-click on the group button in your taskbar and choose Close Group. Now I'm guessing that it won't be too hard (not tha I've ever tried this) to write a macro that trawls the taskbar for buttons with the words "Windows Explorer" and issues a right-click.

 

Thanks. I use TweakUI to customise it more readily than editing the Registry, and that offers several options:

Group least used applications first.

Group applications with the most windows first.

Group any application with at least N windows.

 

(I use the last, with N set to 3.)

 

Your last sentence looks very promising, but what commands can access the taskbar's text labels please?

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

You can't just do a Rrepeat with Windows and close all the explorer windows?

 

 

Thanks, but unfortunately no. Because after using a command like

Repeat with Windows: Visible Windows: Store in variable %T[1]%

 

and reading T1, there's no way of identifying which are the Explorer windows. I have no path shown in my Explorer window title bars (as otherwise it's often impossible to identify the folder unless you make it excessively wide). Although that does give me an idea. I suppose I could temporarily change

Tools > Folder Options > View > Display the full path in the title bar

so that the path was shown, and then try to deduce that a value of T1 was an Explorer window by analysing its content, e.g looking for '\' characters.

 

But if I can find some way of implementing Paul's suggestion of trawling through the taskbar to identify the 'group entry', that would be much easier.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I've just emailed you a tiny .exe I've written in AutoIt, which does exactly this. Let me know how it goes.

 

Thanks Paul. Did you send via a PM here? Don't see anything yet. Or normal email to terrypinATdialDOTpipexDOTcom? If the latter, maybe my over-zealous spam washer zapped it before I could see it.

 

Yesterday I was also recommended to a nice tool which I'd never heard of before. I've installed it and it does the job sweetly. It's a small command-line tool with lots of other uses, called NirCmd by Nirsoft, from

http://www.nirsoft.net/utils/nircmd.html

 

Before that I thought I'd found a neat way of doing it with ME Pro: use Win+Tab to cycle through the taskbar entries, then Sh+F10 to open the context menu, and then just r-click on 'Close Group'. But I don't see how to recognise when the grouped Explorer taskbar item is the one selected?

 

Another idea I had that I'm confident would work is this: open XP Task Mgr, open the Applications tab, then use pixel logic tests to find each yellow Explorer icon, r-click and choose End Task.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Or you could switch to windows and if the application on top is Explorer.EXE kill it.

 

Thanks Cory, but doesn't closing Explorer.exe almost shut down normal XP operation, at least for a while? I'll resist the temptation to try it right now, but I do recall using it only as a final last ditch resort short of re-booting.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Thanks Cory, but doesn't closing Explorer.exe almost shut down normal XP operation, at least for a while?
I wasn't suggesting you kill the explorer process. I was suggesting you Repeat With Windows and in that loop activate each window and check to see if the process for the on top window was Explorer and if it is close that window. It's an admittedly sloppy fix and I'm not even sure it would work. You should try the AutoIT avenue first.
Link to comment
Share on other sites

I wasn't suggesting you kill the explorer process. I was suggesting you Repeat With Windows and in that loop activate each window and check to see if the process for the on top window was Explorer and if it is close that window. It's an admittedly sloppy fix and I'm not even sure it would work. You should try the AutoIT avenue first.

 

Both nircmd and Paul's AutoIt work fine.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...