Alright so here's the deal. I'm building 8 machines. Windows XP Professional. Games like Starcraft, Warcraft, Age Of Empires etc. will be installed, so the machines are 1.8GHz, 256MB of ram, and a 10GB HD. Yes, it's what I had lying around lol. So I'm building these as console systems, they aren't connected to a domain, and once configured they will be frozen with Deepfreeze. They're using the Windows Welcome screen for logging in, each game has it's own useraccount within a very stripped down interface. So for example, click STARCRAFT user with a Starcraft icon as the user icon, and Starcraft launches since it will be in STARCRAFT's Startup folder. Sounds simple so far! I'd like to take it a step further. When the game is quit, no matter what game it is, can I have a script [I need your help] that will log off the user and send them back to the Welcome screen? I don't need to prevent minimizing or anything like that, these aren't super secure machines. I'd just like the process to be as smooth as possible. So here's what'll happen.
•User powers up machine
•Welcome screen appears
•User selects game [user account]
•[User account logs in] Game starts
•User closes game or chooses quit [user account logs off and sends user back to welcome screen]
That last bracket is what I need help with. Any ideas? Thanks so much in advance!
I think what you need if I'm thinking correctly is a .bat file which opens the game and sits in the background and waits for the program to exit then detects the close (I'm not an expert in this sort of thing)
Have found this that might help in the mean time Hey, Scripting Guy! How Can I Log a User Off After 5 Minutes of Inactivity?
You can use vbscript and use WMI to monitor for the process name using win32_process and when the process for the game ends force a logout which will take them back to the welcome screen.
Dont have time to post an example but will check back later and see if srochford or someone else has posted back.
If you start the games through a batch file instead you could use the following:
Code:start /wait "C:\Games\Starcraft.exe" shutdown /l
that looks too simple!!! run that batch file from the logon script and your sorted!
James: Will this only work as a batch file or will a VBS do it also?
All it is, is a couple of cmd-line commands.
The first one starts a program, then pauses the batch until that program closes.
The second one forces a logoff.
I love simple solutions. I'm not sure whether or not you could do something similar in VBS, but I'd be very suprised if you couldn't.
VBS would be:
the WMI stuff to log off is a bit of overkill - you could just do:Code:set oShell=createobject("wscript.shell") sCmd="C:\Games\Starcraft.exe" oShell.run,,true 'true forces it to wait for process to finish Set OpSystems = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true") for each OpSys in OpSystems OpSys.Win32Shutdown 0 next
you then run this with "wscript <name of vbscriptfile>" (you want wscript otherwise a cscript window will lurk in the background)Code:sCmd="shutdown /l" oShell.run sCmd

Why not just change the shell application of each different user to be the game itself. That way only the game loads and when they quit it logs out, no scripting nessisary:
How To Change The Windows Xp Shell.
It also saves a few of those prescious CPU cycles and megabytes of RAM for the games themselves as explorer is not running in the background.
Make a .exe with links to the programs then use a local gp to use a custom GUI
User Configuration | Administrative Templates | System | Custom user interface
These options are fantastic so far! Thanks guys! I'm thinking of the Windows Shell idea but I've got lots to play with at the moment! Thank you so much.
I'm also interested in that last question, if it is the shell, will it force them to go back to welcome screen or will it just show a blank screen?
::EDIT::
Also, while I'm here, what do you think is the best way to image these? They're not on a domain and I'd need to keep the accounts in tact since each account is a different configured game, would sysprep be able to do that? I mean, I'm almost thinking since they're identical to just do a straight disk to disk copy with Ghost and then change the name once the subsequent machines are booted up on each machine.
Any suggestions?
Thanks!
Last edited by link470; 8th April 2009 at 05:06 PM.

When the game application ends it should return you to the logon screen as effectivly the host process for that user session has ended. If the computers are near identical you should be able to get away with a strait image and SID change (probably don't need the SID change but better safe). You could use any imageing tech to do this including Ghost, FOG, Clonzilla, DriveImage XML, WDS (without syspreping the image), Altris etc... etc...![]()
Awsome thanks! Another question, for making the game the shell, how can I make the shell different for every user on the system? Or do I need the shell to be a script that says if this user, use this shell [or game]. Anyone able to explain that quickly? Thank you so much.

You can just change it in the reg for each user:
How To Change The Windows Xp Shell.
Changing the default shell (only current user):
1) open regedit (start menu > run, and type in regedit).
2) go to: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon.
3) add a new string value (Edit > New > String Value) called shell. and set the value to the path of the new shell e.g C:\Litestep\litestep.exe.
4) log out and log back in.
Thank you all once again for your responses so far! Almost there!
Two questions. When I change the shell of say, the Starcraft user, to starcraft.exe, how am I going to change it back since regedit will only do "current user". Starcraft won't give me access to the registry editor. In case I need to change anything I'd like to be able to edit it. Do I log in as Administrator and right click regedit.exe and Run As the Starcraft user?
Second question, I've decided to hide the Administrator account so it's nice and clean and only shows the games on the welcome screen. Normally Administrator is hidden unless it's logged in in which case it's shown so you can click it to unlock your account, but Administrator shows up all the time now for some reason, not sure why. So what I decided to do was follow a tutorial to hide Administrator. That's fantastic, it worked. Double CTRL+ALT+DEL at the welcome screen to bring it up, the trouble is, if I lock that account or if I leave the screensaver on so when I shake the mouse it goes back to the welcome screen, the Administrator account is hidden still, AND CTRL+ALT+DEL doesn't work. So I have no choice but to use the Turn off computer link in the bottom left and log Administrator out and restart. Any suggestions? Thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)