Re: Permissions again
- From: Eduardo <mm@xxxxxx>
- Date: Sat, 12 Sep 2009 06:12:11 -0300
mayayana escribió:
* I edit C:\documents and settings\desktop.ini
as Admin: Access denied, even though I have
full permission.
How are you reading the permissions?
But the fake Admin is limited
to right-click Run As Admin, commandline, and scenarios
where Windows shows an elevation prompt. If your
software is not asking for Admin rights via manifest
then fake Admins will never be given a chance to elevate.
As I said before, that's good enough for me. If
I get access denied then at least I can know that
and inform the person that they need to elevate.
You can request to elevate without manifiest:
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As _
String, ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Declare Function IsUserAnAdmin Lib "shell32" () As Long
Private Sub Form_Load()
If IsUserAnAdmin = 0 Then
ShellExecute Me.hwnd, "runas", App.Path & "\" & _
App.EXEName & ".exe", Command, vbNullString, 0
End
End If
End Sub
You also should check the OS version because the API function IsUserAnAdmin is not available in older Windows.
Or use this other method: http://vbnet.mvps.org/index.html?code/network/isadministrator.htm
Compile and run. The key is the word "runas" in the lpOperation parameter. It request to run as admin.
I was just trying to get a better
understanding, write a complete set of functions,
and invite feedback. So.... we both have what we
need now and no one else seems to be interested. I
guess we're done. :)
:)
.
- Follow-Ups:
- Re: Permissions again
- From: mayayana
- Re: Permissions again
- References:
- Permissions again
- From: mayayana
- Re: Permissions again
- From: Eduardo
- Re: Permissions again
- From: mayayana
- Re: Permissions again
- From: Eduardo
- Re: Permissions again
- From: Eduardo
- Re: Permissions again
- From: Eduardo
- Re: Permissions again
- From: mayayana
- Re: Permissions again
- From: mayayana
- Re: Permissions again
- From: Eduardo
- Re: Permissions again
- From: mayayana
- Re: Permissions again
- From: Eduardo
- Re: Permissions again
- From: mayayana
- Re: Permissions again
- From: Eduardo
- Re: Permissions again
- From: mayayana
- Re: Permissions again
- From: mayayana
- Re: Permissions again
- From: Nobody
- Re: Permissions again
- From: mayayana
- Re: Permissions again
- From: Eduardo
- Re: Permissions again
- From: mayayana
- Re: Permissions again
- From: Eduardo
- Re: Permissions again
- From: mayayana
- Permissions again
- Prev by Date: Re: simple stopwach program
- Next by Date: Re: Duplicate UC during Runtime
- Previous by thread: Re: Permissions again
- Next by thread: Re: Permissions again
- Index(es):
Relevant Pages
|