Link to home
Start Free TrialLog in
Avatar of hberenson
hberenson

asked on

Dedicate a PC to a single application

I want to do something that seems so obvious, and so common, that I'm surprised it's so difficult to figure out how to do.  What I want is that when a user logs into a Windows XP PC they are thrown into an application and can access nothing else on that PC.  They can't get to the Windows Shell or anything else, just run the application.  And when they exit the application they are automatically logged off.  

Running the app is easy enough via a logon script, but that still leaves the user with access to the Windows Shell.

So, how does one truely lock a user into a single application?
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

You replace the shell with the application.  It's a registry setting.
Avatar of hberenson
hberenson

ASKER

That's what I suspected.  Any idea what the registry setting is?
the Shell key in HKLM/SOFTWARE/Microsoft/Windows
NT/CurrentVersion/Winlogon
Anyway to force a logoff when the application exits?  Right now if I just make it the shell when the user exits they still have a live windows session.
Hmmmm... that's a good question.  This isn't an in-house app is it? One that maybe you could reprogram to auto-logoff?  I'll see what I can dig up on that though...
It's Quickbooks actually.  I imagine I could write an application that does nothing but launch quickbooks, wait for it to exit, and then logs off.  I want hoping for something that didn't require app development.
Because of the need to have a logoff occur when the user exits the application we couldn't use the approach that Lee suggested.  Instead I created a logon script that runs the application and waits for it to exit, then logs off.  And I set the registry so that the script is run synchronously.  I borrowed bits of the script from one I found on the net, but it needed some changes.  For example, you run QBW32Pro.exe however it launches another process and exits.  So you have to wait for the "real" process to exit.  The script is below:

Const EWX_LOGOFF = 0
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process")
 
errResult = objWMIService.Create("C:\Program Files\Intuit\QuickBooks 2005\QBW32Pro.exe", null, null, intQBID)

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colProcesses = objWMIService.ExecNotificationQuery _
    ("Select * From __InstanceDeletionEvent " _
            & "Within 1 Where TargetInstance ISA 'Win32_Process'")

Do Until i = 999
    Set objProcess = colProcesses.NextEvent
    If objProcess.TargetInstance.ParentProcessID = intQBID Then
      if objProcess.TargetInstance.ExecutablePath = "C:\Program Files\Intuit\QuickBooks 2005\qbw32.exe" Then
              Exit Do
      End If
    End If
Loop


Set wmi = GetObject("winmgmts:{(Shutdown)}")
Set objSet = wmi.InstancesOf("Win32_OperatingSystem")
For Each obj in objSet
      Set os = obj
      Exit For
Next
os.Win32Shutdown EWX_LOGOFF

ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial