बैच या vbs फ़ाइल का उपयोग करके gpedit.msc, resmon.exe, msconfig.exe को कैसे ब्लॉक करें?

प्रोग्रामिंग


मुझे बैच या वीबीएस फ़ाइल का उपयोग करके gpedit.msc, resmon.exe, msconfig.exe जैसे ऐप्स को ब्लॉक करने की आवश्यकता है, मैंने इन आदेशों को व्यवस्थापक मोड में आज़माया, लेकिन यह काम नहीं कर रहा है

मैंने क्या प्रयास किया है:

बल्ला
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​

समाधान 1

आप बैकग्राउंड ऐप बना सकते हैं, और बैकग्राउंड ऐप पर ऐसा कुछ कर सकते हैं

दूसरा ऐप बंद करें

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