Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Logoff Script failing to run for local users.

01 Apr 2015   #1

Windows 8.1 64Bit
Logoff Script failing to run for local users.

Hey everyone.

We've been experimenting with running a batch script to backup incremental files for users within our domain. We've found that, when the script is run using an Admin account, or by adding the local user to the Admin's group, the script will kick off and run as it should during the Log Off phase.
However, due to security issues, we cannot have all the users having full administration credentials on the systems, so we cannot go down this path.

The Local user account, when the batch script is run manually, runs, and back's up the files as it should. But on Log off, the script doesn't even run, within the log files, there is an Access Denied 5 error 0x0000005.

Now, whilst I can tell this is user permissions error, I've fiddled around with configurations and settings on the local device, the target device on the network and even user accounts, yet, I cannot seem to get this script to execute, as it should, on Logoff, using a standard user account.

Folder permissions are all setup so that the users can read/write and there is no issues with either, as the script will run manually with no output errors and all files successfully copy over.

I am absolutely stumped at the moment, as everything I have tried, does not seem to solve the issue. Only using admin credentials seems to work and due to policies, we cannot allow the users to have Admin rights.

I'm assuming I've missed something simple, so if anyone could point me in the right direction, that would be awesome!

If you need any further info, please let me know...


My System SpecsSystem Spec
02 Apr 2015   #2

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan

Hi Ry,

If you suspect something is amiss with this batch file of yours, we could take a look at it. You'll need to post snippet of this script first (preferably the lines that you think are the cause) for us to view.
My System SpecsSystem Spec
02 Apr 2015   #3

Windows 8.1 64Bit

Hi Pyprohly,

I don't believe the issue is with the script as it will run automatically using an admin account, or using a normal user account when they are added to the admin groups...
I'll upload the script shortly for you to analyse, I was more thinking it was along the lines of a permission setting somewhere on the local device perhaps?

I'll follow this up shortly with the script

My System SpecsSystem Spec

02 Apr 2015   #4

Windows 8.1 64Bit

Hi all,

Just FYI, we have solved this issue.

The cause:

In the system32, Group Policy, Users, Scripts, Log Off >> it creates the batch file and a batch backup log file. These two files are read only by standard users, so allowing these files to have full access to all user groups, the script executes as it should on log off...
My System SpecsSystem Spec

Thread Tools

Similar help and support threads
Thread Forum
Remote Logoff Users?
Hello everyone, first post here. So here's the pickle: I work in a hospital with a pretty big network. Till now our help desk computers were all Win XP and were recently upgraded to Win 7. Now in Win XP if the help desk person wanted to remote logoff a user (which happens a lot as computers...
Network & Sharing
Logoff script not running at shutdown
I have a script that launches Ccleaner and needs to run at shutdown. Shutdown scripts do not run within the user space as I understand, so I figured I'd use a logoff script which will run while the user is still logged in. The logoff script works when logging off as expected, but does not run...
General Discussion
Is there a way to execute a prgm/script at user logoff/shutdown?
In old WinXP there was a tricky feature in Group Policy editor to execute a script when a User logs off resp. the computer was shutdown. I do not find this feature in Windos 7 (pro). is there another way to execute a *.bat batch script at a) user logoff b) shutdown? Peter
General Discussion
Logoff script timeout?
Just wondering if anyone has come across this before. As part of our logoff script we run a backup application to backup users data to the network. In XP we never had a problem, in Windows 7 a few power users have come across a problem. If they have lots of data that's changed, when the script...
General Discussion
Logoff users with a script?
Hello, The issue I have is my co-workers and I share a VM which we remote into, only one person needs access to it at a time. I have been searching for a way that I could set a script to run when I log on which would log off all other users on the system. I have tried to do it with a simple...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 16:56.
Twitter Facebook