Re: Permissions again

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



* I edit C:\documents and settings\desktop.ini
as Admin: Access denied, even though I have
full permission.

How are you reading the permissions?


Both ways. (API and property page.) But mainly
I was checking the API functionality. So I run
my test program, check CU rights (logged in as Admin)
for the file, and I get back full standard and full specific
rights. (First 9 bytes of specific field set. First 5 bytes
of standard field set. I've forgotten what the hex is
for that. I've been busy exploring how each byte gets
set or doesn't.)
So ...I get denied with full rights, then I give everyone
full rights, then I'm not denied, even though I still have
the same full rights. It's wacky! But it does follow a
certain twisted logic: Fake Admin is prevented from having
Admin rights, but if permission is set for everyone then
Admin rights are no longer required.




You can request to elevate without manifiest:


Thanks. I wasn't aware of that method. When you
mentioned it before I thought you meant that you
were shelling from command line. So far I've been
avoiding asking for Admin rights. I try to make it
so that people will have rights within my program
folder, and I can keep my operations there. In some
cases people will need Admin rights just to use the
program functionality. But that's up to them.

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.




.



Relevant Pages

  • Re: Should I still buy SBS 2003 Premium w/ ISA in light of XP SP2s ICF2?
    ... Admin rights is a very simple story. ... relying upon the firewall to block accordingly the access to workstations, ... don't have the same level of packet-filtering in your favor that ISA ...
    (microsoft.public.windows.server.sbs)
  • Re: Randy
    ... This posting is provided "AS-IS" with no warranties or guarantees and confers no rights. ... Microsoft MVP - Directory Services ... it is best practice design to create an empty place holder root domain to ... hold the enterprise admin group and to hold the forest schema operations ...
    (microsoft.public.windows.server.active_directory)
  • RE: Impact of removing administrative rights in an enterprise running XP
    ... While it is true that you can push out patches and software via group ... reporting mechanisms for software/patch installations whatsoever. ... Quite often, the admin rights are ...
    (Focus-Microsoft)
  • Re: Access 97 Security issue Cant make a MDE
    ... I am not able to CHANGE these rights. ... Normally I work as both the Owner of the database (and all objects ... we don't reset this table permission after making the mde. ... we give database admin permission to our user group. ...
    (microsoft.public.access.security)
  • Re: Impact of removing administrative rights in an enterprise running XP
    ... the network admin is "Admin" of the network... ... they should only have/need the appropriate rights for their role in the firm. ... reporting mechanisms for software/patch installations whatsoever. ...
    (Focus-Microsoft)