0

I found this code for disabling the task manager in Windows XP. It works :)

But does it work in Windows 7, too? The registry path is the same, I've checked this. But maybe there are some restrictions!?

Thanks in advance!

4

2 に答える 2

3

By default, the below keys have "readonly" access for standard users since Windows 2000 (See here).

  • HKLM\Software\Policies
  • HKLM\Software\Microsoft\Windows\CurrentVersion\Policies
  • HKCU\Software\Policies
  • HKCU\Software\Microsoft\Windows\CurrentVersion\Policies

So your application needs to have administrative privileges in order to write to these keys.

于 2010-05-19T22:55:50.847 に答える
1

Yes, it works in Windows 7 too. I ran the program with raised privileges (Windows 7 Home Premium), and after that the Task Manager is no longer available.

But, as a sidenote, I have to say that the code

case YesNo of
  False:
    begin
      WriteInteger('DisableTaskMgr',1) ;
    end;
  True:
    begin
      WriteInteger('DisableTaskMgr',0) ;
    end;
end;

is rather horrible. First of all, there is no need at all for the begin and end parts, because the commands WriteInteger... are "one-liners". Secondly, why not just write the value of not YesNo?

One really should write the code as

WriteInteger('DisableTaskMgr', byte(not YesNo));

Isn't that much more readable and brief?

于 2010-05-21T17:42:31.927 に答える