Shell Launcher
Collapse the table of content
Expand the table of content

Shell Launcher (Industry 8)

7/8/2014

Learn how to configure Shell Launcher on your Windows Embedded 8 Industry (Industry 8) device.

By default, Windows Embedded 8 Industry (Industry 8) uses Explorer.exe as its default shell. However, you can enable Shell Launcher and use it to replace the default Windows 8 shell with a custom shell. You can use any application or executable as your custom shell, such as a command window or a custom dedicated application.

Dn195623.Caution(en-us,WinEmbedded.81).gifCaution:
You may specify any executable file to be the default shell except C:\Windows\System32\Eshell.exe. Using Eshell.exe as the default shell will result in a blank screen after user logon.

You can also configure Shell Launcher to launch different shell applications for different users or user groups.

Dn195623.note(en-us,WinEmbedded.81).gifImportant:
You cannot use Shell Launcher to launch a Windows 8 app as a custom shell. However, you can use Windows 8 Application Launcher to launch a Windows 8 app at startup. For more information, see Application Launcher.

Shell Launcher processes the Run and RunOnce registry keys before starting the custom shell, so your custom shell doesn’t need to handle the automatic startup of other applications and services.

Shell Launcher also handles the behavior of the system when your custom shell exits. You can configure the shell exit behavior if the default behavior does not meet your needs.

Launch Different Shells for Different User Accounts

By default, Shell Launcher runs the default shell, which is specified when you configure Shell Launcher.

You can configure Shell Launcher to launch a different shell for specific users or groups if you do not want to run the default shell. For example, you might configure a device to run a custom application shell for guest accounts, but run the standard Windows Explorer shell for administrator accounts in order to service the device.

If you use the WMI providers to configure Shell Launcher for a user or group at run time, you must use the security identifier (SID) for that user or group; you cannot use the user name or group name. If you use Embedded Lockdown Manager (ELM) to configure Shell Launcher, ELM converts user and group names to their SID value.

For more information about common security identifiers, see Well-known SIDs. For more information about ELM, see Embedded Lockdown Manager (ELM) Technical Reference.

When the account currently signed in to belongs to two or more groups that have different configurations defined for each group, Shell Launcher uses the first configuration it finds. The search order is not defined, so we recommend that you avoid assigning a user to multiple groups with different Shell Launcher configurations.

Perform an Action When the Shell Exits

When a custom shell exits, Shell Launcher can perform one of four actions, based on the following return codes:

Return code

Action

0

Restart the shell.

1

Restart the device.

2

Shut down the device.

3

Do nothing.

Dn195623.note(en-us,WinEmbedded.81).gifImportant:
Make sure that your shell application does not automatically exit and is not automatically closed by any features such as Dialog Filter, as this can lead to an infinite cycle of exiting and restarting, unless the return code action is set to do nothing.

Default Return Code Action

You can define a default return code action for Shell Launcher with the DefaultReturnCodeAction setting. If you do not change the initial value, the default return code action is set to 0 (zero), which indicates that Shell Launcher restarts the shell when the shell exits.

Map the Exit Code to a Shell Launcher Action

Shell Launcher can take a specific action based on the exit code returned by the shell. For any given exit code returned by the shell, you can configure the action that Shell Launcher takes by mapping that exit code to one of the shell exit actions.

If the exit code does not match a defined value, Shell Launcher performs the default return code action.

For example, your shell might return exit code values of -1, 0, or 255 depending on how the shell exits. You can configure Shell Launcher to restart the system (1) when the shell returns a value of -1, restart the shell (0) when the shell returns a value of 0, and shut down the system (2) when the shell returns a value of 255. Your custom return code action mapping would look like this:

Exit code

Action

-1

1 (restart the system)

0

0 (restart the app)

255

2 (shut down the system)

See Shell Launcher WMI Provider Reference for more information on the Shell Launcher WMI Settings.

Configure Shell Launcher

You can configure Shell Launcher at run time. All configuration settings for Shell Launcher are stored in the registry, and configuration changes take effect immediately. You can configure the following options:

  • Specify a shell configuration for a specific user or group.
  • Remove a shell configuration for a specific user or group.
  • Change the default shell configuration.
  • Get information on a shell configuration for a specific user or group.

Cmd.exe as a Shell

Dn195623.note(en-us,WinEmbedded.81).gifNote:
If you use cmd.exe as the shell, we recommend that you turn off the default Modern UI themes.

Run-Time Configuration

Dn195623.Caution(en-us,WinEmbedded.81).gifCaution:
You may specify any executable file to be the default shell except C:\Windows\System32\Eshell.exe. Using Eshell.exe as the default shell will result in a blank screen after the user signs in.

You can use the Shell Launcher WMI providers directly in a PowerShell script or in an application to configure Shell Launcher at run time. You can also use Embedded Lockdown Manager (ELM) to configure Shell Launcher. The ELM can generate PowerShell scripts that use the WMI providers.

See Shell Launcher WMI Provider Reference for more information about Shell Launcher WMI providers.

See Embedded Lockdown Manager (ELM) Technical Reference for more information about the ELM.

Shell User Rights

A custom shell is launched with the same level of user rights as the user signed in. This means that a user with administrator user rights can perform any system action that requires administrative user rights, including launching other applications with administrator user rights, while a user without administrator access cannot.

Dn195623.Caution(en-us,WinEmbedded.81).gifCaution:
If your shell application requires administrator user rights and needs to be elevated, and User Account Control (UAC) is present on your device, you must disable UAC in order for Shell Launcher to launch the shell application.

Configure Shell Launcher Behavior by Using Embedded Lockdown Manager (ELM)

Before enabling a custom shell, you need to configure the Shell Launcher behavior for all user accounts. See Shell Launcher for information on how to configure Shell Launcher behavior using ELM.

Create Custom Shell Registry Scripts

Shell Launcher is enabled on Industry 8 by changing the registry key HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell. The default value of this key is “explorer.exe”.

To simplify this process, you can create the following two files and save them to the root of your system drive. You can create additional scripts with other shell options.

Dn195623.note(en-us,WinEmbedded.81).gifImportant:
If your shell does not have a way to start Reg.exe or Regedit.exe so that you can restore the changes to the default Windows registry hive, you may have to modify the registry offline or reinstall if you are not familiar with offline registry editing.
Shell_eShell.reg

This script changes your shell to be eShell.exe.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Shell"="eShell.exe"
Shell_Explorer.reg

This script changes your shell to be explorer.exe.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Shell"="explorer.exe"

Change Shells

Dn195623.note(en-us,WinEmbedded.81).gifImportant:
Before you begin to change your system registry, note the name of your administrator account and ensure that account has a password. You cannot reverse the changes you are about to make unless your administrator account has a password. The only other way to reverse these changes is to modify the registry offline or to reinstall.

  1. On the Start screen, type “Command Prompt”.

  2. In the Apps results list, right-click Command Prompt and then click Run as Administrator.

  3. At the command prompt, import your eShell registry script by typing the following:

    Reg import %systemdrive%\Shell_eShell.reg
    
  4. Restart your device.

  1. At an elevated command prompt, type Regedit.

  2. In the User Account Control dialog box, click Yes.

  3. On the File menu, click Import, then navigate to your script location and select Shell_Explorer.reg.

  4. In the confirmation dialog box, click Open, and then click OK.

  5. Restart your device.

Show:
© 2016 Microsoft