Escolar Documentos
Profissional Documentos
Cultura Documentos
Key1 is a string value. When Windows XP starts, Key1 is called and the default W
indows shell is started. However, if the default value is changed to USR:Softwar
e\Microsoft\Windows NT\CurrentVersion\Winlogon, Windows looks in the HKEY_Curren
t_User key to start a specific shell for the user logging on. If the specific us
er shell is not found, Key2 is called and a default shell is started.
Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFile
Mapping\system.ini\boot\Shell
Type: REG_SZ
Value: SYS:Microsoft\Windows NT\CurrentVersion\Winlogon
Key2 provides a default shell if the user shell application cannot be found. Whe
n you select a shell component for a Microsoft Windows XP Embedded configuration
, Key 2 is set up to the shell application as the default shell.
Key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogo
n\Shell
Type: REG_SZ
Value: Explorer.exe (or this can be a different default application)
Key3 sets up a shell for the current user or logged-on user. Thus, the only way
to change a particular user's shell is to log on to the user account and create
this registry entry.
Key: HKEY_Current_User\Software\Microsoft\Windows NT\CurrentVersion\Winlogon
\Shell
Type: REG_SZ
Value: c:\windows\system32\account shell.exe, where account shell.exe is the
name of the application
How It Works
When the user logs on, Windows uses Key1 to determine which key holds the shell
information. Normally, Windows uses Key2 next. However, if the value of Key1 is
changed to USR:Software\Microsoft\Windows NT\CurrentVersion\Winlogon, Windows wi
ll use Key3 for the user logging on to start the user's specific shell.
Changing the registry key values in a system with a registry already set up is f
airly straightforward. The challenge is how to do this in Windows XP Embedded, w
here the registry is set up during the First Boot Agent (FBA) process.
HKLM keys can be set up in Target Designer because they are computer specific. S
etting up the HKCU keys, however, is impossible in Target Designer because the a
ccounts will not be created until after FBA runs. The user account and administr
ator account components create only the accounts, user names, and passwords. The
se components cannot be used to set up a specific shell. The only solution is to
set up the specific shells after the Windows XP Embedded image has completed th
e FBA process.
d after the FBA process is completed, the last step is to set up the user accoun
t for the system shell. Because you initially set up the image to start in the a
dministrator shell, you should be able to access the registry.
Setting Up Key3
To set up the user account with the unique shell, you must log on to the user ac
count and add Key3 to set the path to the system application. Note that you cann
ot log on to the administrator account to change the user account's shell. After
you log on to the user account, you can use Regedit.exe, Windows Script, or ano
ther application to create Key3 and set the path to the application.
The following is an example of WScript.
'Windows Script to set a user shell
set shell = CreateObject("WScript.shell")
shellpath = InputBox ("Enter the path and name of the EXE application
to be this user's shell. Example: c:\windows\system32\cmd.exe:")
if shellpath <> "" then Shell.RegWrite
"HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell", shellpath, "
REG_SZ"
The following is an example of CScript.
'Windows Script to set a user shell
set shell = CreateObject("WScript.shell")
wscript.stdout.WriteLine "Change the Shell for this user."
wscript.stdout.WriteLine
ChangeReg
sub ChangeReg
wscript.stdout.WriteLine "Enter the path and name of the EXE application to be t
his user's shell."
wscript.stdout.WriteLine "Example: c:\windows\system32\cmd.exe or type QUIT to e
xit: "
if wscript.stdin.AtEndOfStream then exit sub
shellpath = wscript.stdin.ReadLine
if ucase(shellpath) = "QUIT" then exit sub
Shell.RegWrite "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
", shellpath, "REG_SZ"
wscript.stdout.WriteLine "User will now have a new shell"
wscript.stdout.WriteLine
end sub
After you set Key3, you can log off and log on again to the user account and/or
the administrator account. The user account's specific shell will be started whe
n you log on to the user account. The default/administrator shell will be starte
d when you log on to the administrator account.
Extra Notes
By default, Windows Script engine is set up for WScript. WScript uses dialog box
es for input and output messages. CScript uses only a command prompt, which is i
deal for headless systems. You can change to CScript only from an administrator
account. If you decide to use a Windows Script Engine, you must modify the regis
try data for the Windows Script Engine component for the Microsoft Visual Basic S
AutoLOGON
You can use Registry Editor to add your log on information. To do this, follow t
hese steps:
Click Start, click Run, type regedit, and then click OK.
Locate the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
Using your account name and password, double-click the DefaultUserName entry
, type your user name, and then click OK.
Double-click the DefaultPassword entry, type your password under the value d
ata box, and then click OK.
If there is no DefaultPassword value, create the value. To do this, follow t
hese steps:
In Registry Editor, click Edit, click New, and then click String Value.
Type DefaultPassword as the value name, and then press ENTER.
Double-click the newly created key, and then type your password in the V
alue Data box.
Note: If the DefaultPassword registry entry does not exist, Windows XP autom
atically changes the value of the AutoAdminLogonregistry key from 1 (true) to 0
(false) to turn off the AutoAdminLogon feature after the computer is restarted.
Double-click the AutoAdminLogon entry, type 1 in the Value Data box, and the
n click OK.