Run Multiple Explorer.Exe At A Time


  1. Posts : 16
    Windows 7 Ultimate x64
       #1

    Run Multiple Explorer.Exe At A Time


    Hello guys,..

    Actually i am using below bat command to terminate all explorer.exe in task manager and then after termination restarting it !
    But have little problem,..after termination of explorer.exe from all users it at last opens only 1 explorer.exe for the guy who runned that bat file

    @echo off
    taskkill /f /IM explorer.exe
    start explorer.exe >nul
    exit
    So any way to upgrade my above little code so that it can open all other users explorer.exe which are terminated in first step.
      My Computer


  2. Posts : 2,497
    Windows 7 Pro 64 bit
       #2

    That is actually a big problem, one for which I see no practical solution. Windows allows you to run a program as another user, the problem being you would need to know the login credentials of that user. The ability to do otherwise would be a security risk. On general principles you should not know another users password and there is no way to determine this.

    On general principles you really shouldn't be terminating processes belonging to another user. This could only be justified under exceptional circumstances. Actually why are you terminating any instances of explorer.exe?
      My Computer


  3. Posts : 16
    Windows 7 Ultimate x64
    Thread Starter
       #3

    I am terminating explorer.exe and reopening because to refresh all users accounts.
    Like suppose i edit some registry settings so it needs pc restart to see the effect. So by killing explorer.exe and reopening that again results in refreshing the effects or registery edits!
    So that's why asking how to kill and reopen explorer.exe for all users in some single click :)
      My Computer


  4. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #4

    Adonix, you do realise that your batch file will kill every user's Explorer process if and only if the script is run as administrator, and if the script is not running elevated, it will only kill the current user's Explorer process.

    Also worth noting, if you start an instance of Explorer through an elevated process, the resulting Explorer process will be elevated, and thus will all processes that this new Explorer spawns. It would be a bit like using the builtin Administrator account.

    Adonix44 said:
    So any way to upgrade my above little code so that it can open all other users explorer.exe which are terminated in first step.
    I too do not see a practical solution here. It's very tricky to start an application on another user's desktop.
      My Computer


  5. Posts : 2,497
    Windows 7 Pro 64 bit
       #5

    It is possible to run a program in another users session. Processor Hacker can do that. But that process will be running under your account, as will all child processes it may start. That is not acceptable for the explorer.exe process. And then there are the issues pointed out by Pyprohly. What you want might conceivably be done but it would require some very sophisticated programming and break more than a few rules in the process. This is far beyond what could be done with a batch file.

    Messing with another users session is not something you should normally be doing. You need a really compelling reason to do this. Your proposed solution (if it could be done at all) would create all kinds of problems). This is one of those things that seem simple on the surface, something that could be done with a simple batch file. But when you have to confront the harsh facts of reality they become anything but simple. When a proposed solution is that complex that is a good indication that your entire approach is wrong.
      My Computer


  6. Posts : 16
    Windows 7 Ultimate x64
    Thread Starter
       #6

    @echo off
    taskkill /f /IM explorer.exe
    start explorer.exe >nul
    exit
    last thing if we use this above trick to kill explorer.exe and then re open it, then it kills explorer.exe for all users,..so is there any code to kill only explorer.exe of that person who uses this code ? and not others explorer.exe can be closed ??
      My Computer


  7. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #7

    LMiller7 said:
    It is possible to run a program in another users session. Processor Hacker can do that.
    How?


    Also, Adonix, your batch file...
    Code:
    @echo off
    taskkill /f /IM explorer.exe
    start explorer.exe
    exit
    can be simplified to,
    Code:
    @tskill explorer
    where the command 'tskill explorer' is the common way of refreshing the Explorer process, and the '@' in front of the line supresses the prompt text for that line (in contrast to '@echo off' which supresses the prompt text for the entire script), and the 'exit' command is not really needed.



    Edit: (the above post was submitted in the same minute as this post)
    Adonix44 said:
    if we use this above trick to kill explorer.exe and then re open it, then it kills explorer.exe for all users,..so is there any code to kill only explorer.exe of that person who uses this code ?
    Yep. Refreshing Explorer for the current user is precisely what the simplified version of your batch snippet I've just posted does.

    The command,
    Code:
    taskkill /f /im explorer.exe
    does not kill all instances of Explorer.exe for all user's on its own. Only if you run the command as administrator it will.
      My Computer


  8. Posts : 2,497
    Windows 7 Pro 64 bit
       #8

    Processor Hacker has facilities to run a program under another session or user. These are accessible from the "Run As" command under the "Hacker" menu. Of course to run as another user you need to know the users password. You can also run a program in a different users session with your own account. I know this works because I have done it. As for the details of how it is done, for that you would need to ask the developer.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:53.
Find Us