none
Custom Shell an Run / Run Once RRS feed

  • Question

  • Hello,

    This page indicates that when using the Custom Shell, the Shell Launcher will handle the Run, RunOnce, etc. I have configured my image with Command Prompt Shell with Custom Shell Support.

    I have the following set up:

    HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher\Shell = "cmd.exe"

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell = "explorer.exe" (so the default is the explorer shell)

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\system.ini\boot\Shell = "USR:Software\Microsoft\Windows NT\CurrentVersion\Winlogon" (so it will check the shell key below for the logged in user and use that or fallback to the default above)

    HKEY_Current_User\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell = "C:\Path\To\CustomShell.exe"

    Whatever I set in HKCU\Software\Microsoft\Windows\CurrentVersion\Run does not run for the user using the custom shell. If I set it for the user that uses the explorer shell it runs.

    Am I doing something wrong or is the documentation wrong? I'm trying to run something as that user instead of as a service to avoid permission issues. I appreciate any clarity that you all have on this. Thanks!

    Thursday, July 27, 2017 9:09 PM

Answers

  • Willi,

    Thanks for your suggestion. I had tried the eshell.exe there with no luck, but your idea inspired me to revisit all the associated keys and I was able to get it to work.

    Ultimately, I ended up with (changes in bold):

    HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher\Shell = "C:\Path\To\CustomShell.exe"

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell = "eshell.exe"

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\system.ini\boot\Shell = "USR:Software\Microsoft\Windows NT\CurrentVersion\Winlogon" (so it will check the shell key below for the logged in user and use that or fallback to the default above)

    HKEY_Current_User\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell = "explorer.exe" (for any account I want to have the explorer shell, deleted the key for accounts that use the custom shell)

    I needed to set the custom shell in EEF instead of in HKCU\...\Winlogon\Shell


    • Edited by ProLogic1 Monday, July 31, 2017 7:33 PM
    • Marked as answer by ProLogic1 Wednesday, August 2, 2017 12:13 PM
    Monday, July 31, 2017 7:32 PM

All replies

  • I'm not 100% sure, but AFAIK the Run and RunOnce registry entries may be processed by two applications in WES7:

    • explorer.exe
    • eshell.exe

    I think the problem is that you have put "explorer.exe" into the HKLM\Software\....\Winlogon registry key (AFAIK, the custom shell puts "eshell.exe" there). My knowledge is that eshell.must be placed there, otherwise Custom Shell will not take any effect. See also this forum thread.

    Saturday, July 29, 2017 10:44 AM
  • Willi,

    Thanks for your suggestion. I had tried the eshell.exe there with no luck, but your idea inspired me to revisit all the associated keys and I was able to get it to work.

    Ultimately, I ended up with (changes in bold):

    HKLM\Software\Microsoft\Windows Embedded\EEF\Shell Launcher\Shell = "C:\Path\To\CustomShell.exe"

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell = "eshell.exe"

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\system.ini\boot\Shell = "USR:Software\Microsoft\Windows NT\CurrentVersion\Winlogon" (so it will check the shell key below for the logged in user and use that or fallback to the default above)

    HKEY_Current_User\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell = "explorer.exe" (for any account I want to have the explorer shell, deleted the key for accounts that use the custom shell)

    I needed to set the custom shell in EEF instead of in HKCU\...\Winlogon\Shell


    • Edited by ProLogic1 Monday, July 31, 2017 7:33 PM
    • Marked as answer by ProLogic1 Wednesday, August 2, 2017 12:13 PM
    Monday, July 31, 2017 7:32 PM
  • I tried it with my own system, and can tell following:

    First of all you need to know that the Compionent "Command Prompt Shell with Custom Shell Support" does not support different shell for different users (whis has been introduced with WE8S).

    To get "Custom Shell" working correctly, you need to set up following registry entries:

    1) Invoke Custom Shell launcher
    
    Key    : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
    Value  : Shell
    Type   : REG_SZ
    Data   : eshell.exe
    
    2) Configure Shell Launcher to launch your custom application:
    
    Key    : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Embedded\EEF\Shell Launher
    Value  : Shell
    Type   : REG_SZ
    Data   : your_shell_app.exe


    The most easist way to add "Custom Shell" properly is to add the "winemb-interface-cmd" package from your distribution share using dism:

    dism /online /Add-Package /PackagePath:{packt to package}

    After the reboot you might have a command prompt only - open regedit and customize following key to your needs:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Embedded\EEF\Shell Launher

    See also: https://msdn.microsoft.com/en-us/library/hh300749(v=winembedded.21).aspx


    • Edited by Willi K Tuesday, August 1, 2017 8:06 AM Added link to documnentation
    Tuesday, August 1, 2017 8:03 AM
  • Willi,

    I can confirm that I had the correct package installed. You are technically correct the Command Prompt Shell with Custom Shell Support does not support different shells for different users in so much as you can't configure that in ICE. However, as I noted above, you can make registry changes to do that. 

    I essentially had configured my setup to have the default shell as explorer.exe and then a per user override to the custom shell. I believe this is how most general Windows users change their shell.

    I did not properly setup my image. I needed the default shell to be eshell.exe and the EEF key needed to be my custom shell. This makes the custom shell the default shell (and all this could've been done with ICE to begin). I could then override the custom shell per user as I was dong before.

    That is the key to maintaining the Run/RunOnce functionality when running a custom shell.

    Tuesday, August 1, 2017 12:23 PM
  • I see. One last suggestion:

    • Leave eshell.exe in the HKLM\...\Winlogon key, this will ensure that your Run/RunOnce entries will be processed.
    • In the EEF registry path launch a program/script that reads the Shell-Entry from HKCU (via REG.EXE or powershell), and lauch that application

    Wednesday, August 2, 2017 8:10 AM
  • Willi,

    I did the first and the second is unnecessary because WES7 already has a mechanism to do that outlined in my original post by setting HKLM\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping\system.ini\boot\Shell to a value that causes the HKCU\...\Winlogon\Shell to be checked before falling back to HKLM\...\Winlogon\Shell.

    Wednesday, August 2, 2017 12:12 PM