Làm cách nào để chặn gpedit.msc, resmon.exe, msconfig.exe bằng tệp batch hoặc vbs?

lập trình


Tôi cần chặn các ứng dụng như gpedit.msc, resmon.exe, msconfig.exe bằng tệp batch hoặc vbs, tôi đã thử các lệnh này trong chế độ quản trị viên nhưng không hoạt động

Những gì tôi đã thử:

CON DƠI
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableResmon /t REG_DWORD /d 1 /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableMSCONFIG /t REG_DWORD /d 1 /f
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableGpedit /t REG_DWORD /d 1 /f​

Giải pháp 1

Bạn có thể tạo ứng dụng nền và thực hiện những việc tương tự như thế này trên ứng dụng nền

Đóng ứng dụng khác

using (Process process = Process.Start("resmon.exe")) {

       // Wait for 5 seconds and terminate the process.
       Console.WriteLine("Waiting 1 seconds before terminating" +
           " .exe.");
       Thread.Sleep(1000);

       // Terminate process.
       Console.WriteLine("Terminating with CloseMainWindow.");


  if(process != null)
       // Try to send a close message to the main window.
       if (!process.CloseMainWindow()) {

           // Close message did not get sent - Kill.
           Console.WriteLine("CloseMainWindow returned false - " +
               " terminating with Kill.");
           process.Kill();

       } else {

           // Close message sent successfully; wait for 2 seconds
           // for termination confirmation before resorting to Kill.
           if (!process.WaitForExit(2000)) {

               Console.WriteLine("CloseMainWindow failed to" +
                   " terminate - terminating with Kill.");
               process.Kill();
           }
       }
   }

コメント

タイトルとURLをコピーしました