Closed
Description
Windows Explorer displays an overlayed tiny shield icon for executables that requires an elevation.
Describe the solution
The following function will let you know if an elevation is required for a given executable file path.
[DllImport("shell32.dll", EntryPoint = "#865", CharSet = CharSet.Unicode, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)] private static extern bool IsElevationRequired([MarshalAs(UnmanagedType.LPWStr)] string pszPath);
Usage:
var isElevationRequired = IsElevationRequired(@"C:\Windows\regedit.exe");
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done