Logon/Logoff scripts in Windows XP Professional
Logon/Logoff scripts in Windows XP Professional
(OP)
Can somebody direct me to a good, quick tutorial on the syntax for Windows XP Pro logon/logoff scripts? I tried to write a batch file for my logoff script, but it wouldn't work.
(What I want to do is run an executable with a couple of command-line switches, so if there's a tutorial that cuts all of the other stuff and gets right to that, that would be great)
(What I want to do is run an executable with a couple of command-line switches, so if there's a tutorial that cuts all of the other stuff and gets right to that, that would be great)
RE: Logon/Logoff scripts in Windows XP Professional
Unless you use DOS 8.3 name conventions in your batch files, include the full path to your exe in "". After the last " go one space then /with switch.
Now someone can tell you how to really do it.
RE: Logon/Logoff scripts in Windows XP Professional
1. Create a .bat (or .cmd) script in the proper folder. Use quotes around any commands with spaces in the path. The scripts go in C:\Windows\system32\GroupPolicy\Machine(or User)\Shutdown(or Startup)
2. Then you have to run the Group Policy Editor (start, run, gpedit.msc).
3. Then expand "Windows Settings" under "Computer Configuration" if you put your script under "Machine" or "Windows Settings" under "User Configuration" if you put your script under "User."
4. Select "Scripts (Logon/Logoff)". Then select "Logon" or "Logoff." You will find an empty box in the dialog. Click "Add" to finish configuration of your script.
RE: Logon/Logoff scripts in Windows XP Professional
My project, when installed, needs to perform a certain function when the user logs off. I would like to register this script programmatically at install time.
Is there a command line interface to the Group Policy settings? Or another way to do this?
Thanks in advance...
RE: Logon/Logoff scripts in Windows XP Professional
LogOff scripts are stored in the following key:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff
Under this key each script that you add is given an index number starting with 0.
To view what values you need set up a LogOff script and then go to the key.
Greg Palmer
----------------------------------------
Any feed back is appreciated.
RE: Logon/Logoff scripts in Windows XP Professional
I create a Logoff script using the Group Policy GUI.
the windows registry key:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff
gets created with the value:
C:\WINNT\System32\GroupPolicy\User\Scripts
is this the same way it works on XP?
When I remove the logoff script using the Group Policy GUI, the registry entry goes away.
I recreated the entry manually (something I'll be able to do with install scripts), but my script wasn't executed on logoff.
I'm looking for something simailar to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
which runs it's values on logon. I need the opposite, a key to run value(s) on logoff.
Thanks...
RE: Logon/Logoff scripts in Windows XP Professional
http://www.kixtart.org
especially if you have older (Win9x) clients
RE: Logon/Logoff scripts in Windows XP Professional
You might consider a non-policy approach to the issue. For example, LastChance: http://www.webattack.com/get/lastchance.html