1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Prevent Windows Explorer from loading at logon..

Discussion in 'Windows XP' started by harshadd, 2008/03/30.

  1. 2008/03/30
    harshadd

    harshadd Inactive Thread Starter

    Joined:
    2008/03/30
    Messages:
    11
    Likes Received:
    0
    For some reason I do not want windows [explorer.exe] shell to be loaded after user is logged in on (XP prof).
    Instead a program should start, and if that program is exit, controls should go back to LOGIN screen.
    where do i need to do changes for this?
    Rgds
    Harshad
     
  2. 2008/03/30
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    You would have to write a batch(.bat) file or command file(.cmd) to accomplish this. XP Pro includes a command line utility called taskkill.exe, not present in XP Home but can be used in XP Home if copied to root\windows\system32 dir. Taskkill unloads a process or program.

    You would have to load this script at boot via a registry value such as HKLM\Software\Microsoft\Windows\Current version\Run.

    example: (save as xxxxx.bat or xxxxx.cmd)
    taskkill /f /im explorer.exe
    start XYZ.exe
    pause
    shutdown -l
     
    Last edited: 2008/03/30

  3. to hide this advert.

  4. 2008/03/30
    harshadd

    harshadd Inactive Thread Starter

    Joined:
    2008/03/30
    Messages:
    11
    Likes Received:
    0
    Thanks for your responce, But this is not what exactly I want!! Rather to kill it after getting started, can you suggest a way to NOT to start it only?
    I remember, Windows 3.1x used six .INI files to load and control the Windows environment (CONTROL.INI, PROGMAN.INI, PROTOCOL.INI, SYSTEM.INI, WIN.INI, and WINFILE.INI).
    If you changed PROGMAN.INI / load=explorer.exe to some thing else, it used to load that program. I used to load filemngr.exe there.
    I want something similar to that in XP prof.
     
  5. 2008/03/30
    noahdfear

    noahdfear Inactive

    Joined:
    2003/04/06
    Messages:
    12,178
    Likes Received:
    15
    Explorer loads from the Shell value under the following registry location.
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
    Replace the explorer.exe (or C:\Windows\explorer.exe, whichever it may currently be) Data entry with the path to another app and it will load instead. That will not however automatically log off the account when the program is closed. Tony is ontrack with using a batch to accomplish both. Create a batch with the following 2 lines, inserting the correct path and program executable name for the app you want to run.


    "C:\Program Files\Program\runthisprogram.exe "
    shutdown -l


    Lets say the batch is named runthis.bat and is located in the drive root of C:
    Modify the Shell value to read C:\runthis.bat


    Notice I took out the pause line. That is because it will cause the command window that opens when the batch is executed, to wait for a key press before executing the shutdown command. Notice also that the start command was taken out of the program line. That is because the start command will cause the batch to start the program then read the next line. Without the start command, it will run the program but wait for the program to close before executing the next line.

    Now, since this was done at the HKLM level, it will affect ALL user accounts. If you want to limit the behavior to a particular account only, blank the Shell value on the HKLM location, then go to;

    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon

    and create a REG_SZ (String) value named Shell then point it to the batch. Do this after first logging on to an account which you do NOT want affected and creating the HKCU Shell value that points back to explorer.exe

    Please note that this will not prevent the user from using Ctrl+Alt+Del to open the Task Manager and running whatever they can access via File>New Task, such as explorer or any other app they can browse to. You would need another registry hack or group policy to prevent the use of Ctrl+Alt+Del, or better yet, just prevent the use of Task Manager. Keep in mind you could lock ALL accounts from accessing anything if not done on a per user level.

    This will also allow the user to minimize the running program, which allows access to the batch file's command window, which will be running right behind it. Simply closing the command window will kill the batch and prevent account logoff when the program is closed, leaving just a blank window. You can start the batch minimized by adding the /min switch to the path entered for the Shell value, eg;

    Shell REG_SZ C:\runthis.bat /min

    Or, you can start the batch completely invisible. Save this one line of text as "invisible.vbs" in the drive root

    CreateObject( "Wscript.Shell ").Run " "" " & WScript.Arguments(0) & " "" ", 0, False

    To run the batch file invisibly, use the following line for the Shell value Data.

    wscript.exe C:\invisible.vbs C:\runthis.bat

    Windows Scripting MUST be installed for this to work (included in Windows 98 and later) and MUST be working. To test, click Start>Run and type wscript then hit Enter. A Windows Script Host Settings dialog should open.
     
  6. 2008/04/18
    harshadd

    harshadd Inactive Thread Starter

    Joined:
    2008/03/30
    Messages:
    11
    Likes Received:
    0
    This worked well, in fact I did not changed any key in HKLM, but only added shell in HKCU. and Instead of calling an Explorer.EXE I called a batch script to open a Virtual machine. and on exit of VM it calls shutdown /l, to go back to login prompt.
    This saved my original PC from being used by some people to whom I can not avoid. They used my Virtual machine, (NON persistent) and Happily go.
    Thanks again
     
  7. 2008/04/18
    noahdfear

    noahdfear Inactive

    Joined:
    2003/04/06
    Messages:
    12,178
    Likes Received:
    15
    Glad it worked for you. Thanks for posting back with your results and additional info. :)
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.