News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Access to another user's profile

Started by sinsi, August 23, 2012, 10:11:42 PM

Previous topic - Next topic

sinsi

I connect a hard drive from another computer via USB cable.
Click on the user profile, Windows pops up that I don't have access, do I want access? Click yes.
What happens next? Does Explorer iterate files/directories one by one and change access, or is there one API for that?

No real reason for asking, beyond curiosity (and watching the bar in Explorer spend 90% of its time at 99%).

dedndave

if you want to recursively take ownership...
right-click on the parent folder - properties
Sharing tab
fill in the network sharing stuff and go through all the necessary steps
it will offer you the option of doing just the folder or all the contents

sinsi

Nah, I just want permission to view/copy what's there.
This is a hard drive out of its computer and plugged into mine, not a network. Network shares are different.

I did notice that my user name is now on the permissions for each file and directory.
When I put it back into its computer and boot, I am sure I will find a permission for 'unknown account'

Original question: one by one or one API call?

dedndave


Tedd

It's done hierarchical where possible - the permissions are set on the 'top' folder, and folders below take them from that; usually. But there's also the option to NOT have folders take hierarchical permissions, in which case they need to be set on each and every file/folder.

On the other machine, your username will appear as a GUID, and will require ownership rights to remove. If it was just set on the topmost folder, and they were set hierarchically, then you can remove it once and the rest will automatically be removed. If not, there's an option to update the permissions for all files and subfolders.
Potato2

sinsi

>On the other machine, your username will appear as a GUID, and will require ownership rights to remove.
I have had single files like that, windows tells me that I need permission from 'unknown computer S-1-blah-blah' to take ownership.

Even taking ownership seems to go one by one, click 'apply' and a dialog pops up with filenames blurring along...
Anyway, not much use owning if you don't have permissions.

dedndave

if you are going to reformat the drive anyways...
take permission for the entire drive (partition, actually)
right click on the drive - Sharing tab
pretend as though you were going to share it on a network and go through the steps
i have had to do this in the past