File permissions in Win7: change in the current user session

Good afternoon, dear Habra residents!
Foreword: from time to time it is necessary to set rights to individual folders and files for users at work. In XP, this was done easily and simply (the method, if anyone does not know, under the cut), but with the release of Vista and Seven - an old trusted friend let me down. Let's find out how to quickly set the rights to individual folders and files in Windows under the current user. Save time!

So, first of all, the method that runs in Windows XP:
Run cmd with administrator rights (this is runas / user: domain \ login cmd if someone suddenly forgot and enter the magic command - explorer / separate there .



As a result, we will launch Explorer with administrator privileges. We expose the rights and enjoy our inventiveness.

But the time has come for changes, and on newer systems this command will launch the explorer from the current user.
You can, of course, set rights through administrator balls from your workstation, or run other file managers on your own ... But sometimes you need to set rights here and now, and installing an extra program on a computer that will have to be used once a month is wrong.

So, I found two ways to overcome this situation: one is correct and interesting, the second is fast and funny. Let's start with the first one.

Method 1. For the curious and patient

For differentiation of the rights of the conductor one of COM objects is responsible. Namely - Elevated-Unelevated Explorer Factory .

This miracle is found as follows:
Run cmd with administrator rights - dcomcnfg and then in the DCOM configuration look for the Elevated-Unelevated Explorer Factory parameter .



and there look for our hidden animal:



However, you most likely will not be allowed to edit this parameter. There is no right to change the registry branch HKEY_CLASSES_ROOT \ AppID \ {CDCBCFCA-3CDC-436f-A4E2-0E02075250C2}
When did such trifles stop us? We make ourselves the owner, change the rights and run dcomcnfg again
HURRAH! We can now set the parameter on the Identity - Starting user tab.



A bit chore, right? You can immediately edit the registry key - HKEY_CLASSES_ROOT \ AppID \ {CDCBCFCA-3CDC-436f-A4E2-0E02075250C2} \ RunAs

  • Interactive User value for current user
  • removal of this parameter for the launching user
  • username to launch explorer from a specific user


It is possible to resolve this issue through politicians, but alas, I have not found this, and it is not applicable at work for me. Unless the batch file comes to mind on a registry key. Well, we mastered the first method ...

And now is the time of magic .

Method 2. Fast and fun

Run cmd as administrator, open notepad, select Open and display all files and quietly change the rights to files and folders.

A picture illustrating my eyes at the time of this wonderful discovery is attached:



Thank you for your attention!

UPD
Thanks to the user denis_g and several other Linuxsoids, I remembered that I had read about the console command for managing access rights for a long time - CACLS
Once the syntax
link Two syntax links

It turns out, adding the user with the rights to change is done like this:

cacls PATH: \ To \ FILE / t / e / p username: C

Where are the variables: / t - subdirectories (for folders), / e - edit i.e. change of existing rights, / p - change to user (if not, add), C - read.
Caution, first practice, because you can demolish all the rights to a folder in null!

UPD2 didn’t work for me. Press
SHIFT and select “Run as another user” an explorer explorer ...
image

UPD3 as user tachidi
1) Kill in the processes explorer.exe
2) Run it on behalf of the administrator account
3) Set the necessary password
4) Do not forget to return everything back!

Also popular now: