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?
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?
You replace the shell with the application. It's a registry setting.
ASKER
That's what I suspected. Any idea what the registry setting is?
the Shell key in HKLM/SOFTWARE/Microsoft/Wi ndows
NT/CurrentVersion/Winlogon
NT/CurrentVersion/Winlogon
ASKER
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...
ASKER
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.
ASKER
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:\P rogram Files\Intuit\QuickBooks 2005\QBW32Pro.exe", null, null, intQBID)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecNotifica tionQuery _
("Select * From __InstanceDeletionEvent " _
& "Within 1 Where TargetInstance ISA 'Win32_Process'")
Do Until i = 999
Set objProcess = colProcesses.NextEvent
If objProcess.TargetInstance. ParentProc essID = intQBID Then
if objProcess.TargetInstance. Executable Path = "C:\Program Files\Intuit\QuickBooks 2005\qbw32.exe" Then
Exit Do
End If
End If
Loop
Set wmi = GetObject("winmgmts:{(Shut down)}")
Set objSet = wmi.InstancesOf("Win32_Ope ratingSyst em")
For Each obj in objSet
Set os = obj
Exit For
Next
os.Win32Shutdown EWX_LOGOFF
Const EWX_LOGOFF = 0
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2:Win32_Process
errResult = objWMIService.Create("C:\P
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecNotifica
("Select * From __InstanceDeletionEvent " _
& "Within 1 Where TargetInstance ISA 'Win32_Process'")
Do Until i = 999
Set objProcess = colProcesses.NextEvent
If objProcess.TargetInstance.
if objProcess.TargetInstance.
Exit Do
End If
End If
Loop
Set wmi = GetObject("winmgmts:{(Shut
Set objSet = wmi.InstancesOf("Win32_Ope
For Each obj in objSet
Set os = obj
Exit For
Next
os.Win32Shutdown EWX_LOGOFF
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.