How to disable task manager in windows 7 registry as administrator with excel vba?

cega2006

New member
Joined
Apr 24, 2014
Messages
1
Reaction score
0
Points
0
Hello friends, hope you can help me, I have a excel file with macro with the code vba password protected and shared, but I detect when the user uses the task manager to close to force the excel file, it opens as if he had not put the lock protection vba project.

So I want to disable the task manager while the user open excel book.

I've tried the following code but does not work:

Sub Disable ()
Dim Locat As String
Dim ModifReg As String
Locat = "cd C: \ Windows \ system32"
ModifReg = "REG add HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ System / v DisableTaskMgr / t REG_DWORD / d 1 / f"
Call Shell ("C: \ WINDOWS \ system32 \ cmd.exe / k" & Locat , 1)
Call Shell ("C: \ WINDOWS \ system32 \ cmd.exe / k" & ModifReg 1)

End Sub

When I run it (REG add HKCU ) from cmd as administrator it works , but I need it to work when the user of the macro open the file in any pc.
 

Attachments

  • Disable Task manag.xlsm
    12.7 KB · Views: 52
Back
Top