C# Start/Stop Windows Update

  • 0 Replies
  • 295 Views

0 Members and 1 Guest are viewing this topic.

Offline Omega

    *
  • The Boss (Admin)
  • Black Hat Sec Member
  • Telegram: @BLACKHATSEC_FORUM
  • Posts: 190
  • Popularity: +1/-0
  • God of Malware
    • View Profile
    • Awards
« on: March 14, 2022, 09:46:32 AM »
C# Start/Stop Windows Update


Code
    //START
    try
    {
    ServiceController sc = new ServiceController("wuauserv");
    sc.Start();
    }
    catch (Exception ex)
    {
    MessageBox.Show("service could not be started because of the following _error_:\r\n" + ex);
    }


    //STOP
    try
    {
    ServiceController sc = new ServiceController("wuauserv");
    sc.Stop();
    }
    catch (Exception ex)
    {
    MessageBox.Show("service could not be stopped because of the following _error_:\r\n" + ex);
    }

  • Discord: BLACK HAT SEC#5222
  • [+]
  • [-]

  •