New desktop, need Explorer PID

May 20, 2008
11,619
110
Syracuse, NY, USA
Apparently, stuff in the "StartUp" folder runs when Explorer starts on a new desktop. I have a logon BTM there and want to suppress most of what it does. I already have a plugin _DESK so I can suppress stuff with
Code:
IF "%_DESK" NE "Default" ...

But one of the things I **want** to do requires the PID of Explorer. Since there are two Explorer's running, getting the right one is not trivial. I can squeeze it out of my WHICHWIN plugin (which doesn't see beyond its own desktop) by getting the PID of the process owning the window of class "Progman". And I suppose I could write a plugin that does the same thing more directly. Does anyone have any other ideas?

Thanks.
 
Does anyone have any other ideas?

Thanks.

Hi,
Before starting the next desktop, I use TASKLIST to find the current PID of Explorer; thus;

Code:
tasklist explorer
2540  explorer          Program Manager

After creating a new desktop;

Code:
desktop /c jlc

TASKLIST gives me;

Code:
tasklist explorer
2540  explorer          Program Manager
2652  explorer

Not sure if this is what you are looking for, but it does give the required PID of the new Explorer.

Joe
 

Similar threads

C
Replies
5
Views
2K