¿Cómo bloquear gpedit.msc, resmon.exe, msconfig.exe usando un archivo por lotes o vbs?

programación


Necesito bloquear aplicaciones como gpedit.msc, resmon.exe, msconfig.exe usando un archivo por lotes o vbs. Probé estos comandos en modo administrador, pero no funciona.

Lo que he probado:

MURCIÉLAGO
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​

Solución 1

Puedes crear una aplicación en segundo plano y hacer algo como esto en la aplicación en segundo plano.

Cerrar otra aplicación

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をコピーしました