1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

New desktop, need Explorer PID

Discussion in 'Support' started by vefatica, May 22, 2012.

  1. vefatica

    Joined:
    May 20, 2008
    Messages:
    7,972
    Likes Received:
    30
    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.
     
  2. Joe Caverly

    Joined:
    Aug 28, 2009
    Messages:
    680
    Likes Received:
    8
    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
     

Share This Page