10-05-2023, 11:11 AM
(This post was last modified: 10-05-2023, 11:16 AM by SpriggsySpriggs.)
I've got code somewhere to make a program launch itself as admin. If I find it, I'll send it your way, eoredson.
EDIT: Looks like I found it
Of course, you'll have to accept the UAC prompt.
EDIT: Looks like I found it
Of course, you'll have to accept the UAC prompt.
Code: (Select All)
Declare Dynamic Library "Shell32"
Function IsUserAnAdmin& ()
Sub ShellExecute Alias "ShellExecuteA" (ByVal hwnd As _Offset, lpOperation As String, lpFile As String, lpParameters As String, Byval lpDirectory As _Offset, Byval nShowCmd As Long)
End Declare
Sub SelfElevate
If IsUserAnAdmin = 0 Then
ShellExecute 0, "runas" + Chr$(0), Command$(0) + Chr$(0), Command$ + Chr$(0), 0, 5
System
End If
End Sub
Tread on those who tread on you