10-06-2023, 12:57 AM
Heh.. I tried this:
And it went into a endless loop display dozens of x32 shell windows and had to be forced to reboot.
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
Call SelfElevate
Print "more:";
Do
If Len(InKey$) Then Exit Do
Loop
End
Sub SelfElevate
Print "admin:"; IsUserAnAdmin
'If IsUserAnAdmin = 0 Then
ShellExecute 0, "runas" + Chr$(0), Command$(0) + Chr$(0), Command$ + Chr$(0), 0, 5
'System
'End If
End Sub