Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start Up - Start Down?

Status
Not open for further replies.

bmanzel

IS-IT--Management
Oct 13, 2002
19
CA
I am familiar with the Start Up directory in Windows and I have a program that tracks our employees whereabouts that starts up this way. I would like the same program to start off as part of the logoff procedure as well. The user would logoff, this program would run and once the user closes the program the logoff procedure would continue.

Does anyone have an idea how I can do this?
 
Bmanzel,

Open MMC /a and add the Group Policy snap-in. On a singe machine, it will show up as Local Computer.

You can go to either Computer or User, then Windows and then Scripts.

I use the User logoff script to stop the spooler via a batch file as I log off

Ian

 
is there a way to do this programmatically?

When my software installs, I need to register a process to be run at logoff. There are registry keys that will execute scripts/commands/etc. at logon, but I haven't had any luck finding a way to launch something at logoff.

thanks in advance...
 
If you follow Mapleleaf's instructions - you can define shutdown or logoff scripts as well as startup/logon (running gpedit.msc just opens the local group policy editor - a little quicker than mmc)
 
Thanks, but I need this to be automated via a script/command line/etc. when my software installs, not thru the GUI.

anyone?
 
So why can't your software install process write a batch file into the logoff/shutdown batch file folder? (whose location I can't remember off top of head, but you can find by running gpedit.msc and going to logoff/shutdown script bit & browsing).
 
I did try that. (C:\WINNT\system32\GroupPolicy\User\Scripts\Logoff)

The script was't executed.

There's also a registry entry that the Group Policy editor creates:
HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System\Scripts\Logoff

but the value is the "Scripts" directory (string value), not the script itself. I created this manually, but that didn't work either.

The gpedit.msc program must be doing something else...

thanks again...
 
Nothing is more autopmated than group policies. Install your application locally on each PC and then create the GPO for the log off script to call it. This is the only reliable way to do it. It is also the best way to do it. make your application an MSI and you are in business. 1 GPO to deploy and 1 to run the log off script.
 
Can you put the commands in the Form Close event?



Kind Regards, Paul Benn

**** Never Giveup, keep trying, the answer is out there!!! ****
 
Sorry about that I thought I was in a different Forum...


Kind Regards, Paul Benn

**** Never Giveup, keep trying, the answer is out there!!! ****
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top