SetShell is a Windows NT program for setting the login shell on 
a per user basis. 

The normal shell use in Windows NT is the Program Manager, but this can
be changed by modifying the registry. Unfortunately, this changes the 
shell for all users.

However, if the system wide shell is set to SetShell, this problem is
avoided. When SetShell runs, it examines a registry value (that can be
different for each user) to find the name of the shell for that user,
and creates a process for that program.

To use SetShell, run it once from a command line with the name of the
program that you want for your shell as the only argument. For example:

	SetShell winfile

This registers winfile (the Windows File Manager) as your shell of choice.
A complete path can be specified along with the filename, if the program
is not on your path.

You can test SetShell by running it without any arguments, i.e.:

	SetShell

This should run the program you specified. If for some reason SetShell
cannot create the process (or if there is no shell of choice in the 
registry), it will run the Program Manager instead. SetShell hides itself
after starting the new process, waits for the shell process to exit, then
logs off the current user.

To make SetShell run when you login, use RegEdit32 to modify the registry
entry that specifies your shell. It is:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell

Change it's value from "progman.exe" to "taskman.exe,SetShell.exe", and make
sure SetShell.exe is on your path (I put it in the system32 directory). The
taskman.exe part runs the Windows Task manager in addition to SetShell. Program
Manager starts taskman on its own, but other shells might not.

That's it. Log out, and when you log in again, you should get the shell of 
your choice. 

I wrote SetShell as a convenience, and security was not a big concern for
me. Don't count on using SetShell to limit a users rights on your system.
It is possible to set the shell to be a program that cannot execute other
programs (MineSweeper for example), but you can pop up the task list with
ctrl-esc and start a real shell from there. 

The source code is included. If you make any cool improvements, please 
send me a copy. If you mess up your registry and can't log in, I take no 
responsibility.

Ted Wright
wright@lerc.nasa.gov


