Click here to Skip to main content
15,943,089 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I am writing a windows service that is designed to be a class room management tool. One of the features to this applications is being able to lock the screen. I have everything working correctly except disabling task manager. I have found the group policy for disabling task manager is at "Hkey_Current_User\Software\Microsoft\Windows\CurrentVersion\Policies\System"

However the service is running as local system. So current user isn't equal to the currently logged in user. Also thinking about the problem more I have considered change the permission for C:\Windows\System32\taskmgr.exe to deny user execute permissions. Anyone see a reason this wouldn't work?

Any thoughts or suggest would be greatly appreciated.
Updated 1-Mar-11 19:48pm

1 solution

You can't do it from a service. You'd have to load each user registry hive and poke the value in, then unload the hive, for each account on the machine. Even with just a few accounts, this can be a VERY time consuming process. This is better done simply using Group Policy alone instead of doing it from code.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900