Run a script at WinXP logout?

D

Derekasaurus

I have a script (BAT file) that I would like to run automatically
whenever I log out. This script invokes a backup utility and performs
other maintenance -- the details aren't important.

The WinXP task scheduler doesn't allow this, and the only way I've
found to do this is from the Group Policy editor:

Start -> Run... -> "gpedit.msc" -> OK

Then I add my script to Local Computer Policy -> User Configuration ->
Windows Settings -> Scripts -> Logoff.

The problem is that the script is run when *anyone* logs out, not just
me, but only I have permission to access the files my script accesses.
So everything works beautifully when I log out, but everyone else gets
error messages when they log out.

Does anyone else know a way to automatically run a BAT file at the
WinXP logout that will only be executed for one user (me)?

Thanks.
 
V

Vanguard

Derekasaurus said:
I have a script (BAT file) that I would like to run automatically
whenever I log out. This script invokes a backup utility and performs
other maintenance -- the details aren't important.

The WinXP task scheduler doesn't allow this, and the only way I've
found to do this is from the Group Policy editor:

Start -> Run... -> "gpedit.msc" -> OK

Then I add my script to Local Computer Policy -> User Configuration ->
Windows Settings -> Scripts -> Logoff.

The problem is that the script is run when *anyone* logs out, not just
me, but only I have permission to access the files my script accesses.
So everything works beautifully when I log out, but everyone else gets
error messages when they log out.

Does anyone else know a way to automatically run a BAT file at the
WinXP logout that will only be executed for one user (me)?

Thanks.


Well, a couple ideas off the top of my head:

1 - Set permissions on the .bat file so your account is the only one
that is allowed to read that file.

2 - Add a test in your .bat file to determine if you are the user
currently logged on (that will be logging off), something like:

if NOT "%username%" == "Derek Asaurus" goto BatchEnd
...
:BatchEnd
<cleanup>
exit
 
G

Guest

I am also trying to work around this shortcoming of scheduler in order to
work around Outlook's inability to synchronize. This system worked for my
office computer (XP Pro) with another program to generate an outlook synch
file, after several days of work. Now however, I find this won't work in XP
home since it doesn't have the group policy editor. Does anybody know a way
to run a script at logout in XP home. This is ridiculously difficult for
such an obvious task and soiphisticated OS!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top