AnsweredAssumed Answered

vrf Finding file owner

Question asked by rsb on Apr 30, 2004
"Shawn Fessenden <shawn@testech-ltd.com> wrote:
> Stan,
>
> Compatibility:
>   VEE 5 & up.
>   Win32, NTFS partitions.
>
> > How do I programmatically (.NET preferrably)
> > determine the owner of a given file?
>
> Well, I kinda sorta succeeded, but not really. I found a HOWTO article about
> getting a file's owner account name. The original is VB. The attached is a
> VEE 5 translation of the source code published in the article. The trouble
> is it doesn't seem to get the owner but rather the owner's group
> affiliation.
>
> I double checked everything and it's ok. I went and pasted the published
> code into VB and it works the same way. I don't quite know what the story
> is, but I do know that NT security is one twisted subject. I'm not real sure
> what's going on but it may be because of my setup. I pointed it at a file I
> created under my login and it simply returns "Administrators" for the
> account and "BUILTIN" for the domain. I was expecting "Shawn" and "ALGOL".

Hmm

Works fine for me- thanks Shawn.

When I point this at a file I created as me it says I am owner.
When I point at a file created by an admin, it lists that correctly

The only weirdness I see is when I point at a shortcut, in which
case it returns 'administrators' regardless of who owns the shortcut.

How do you get the "domain"?

I'm running XP

Stan


--------------------------------------------------------------------------
Stan Bischof  Agilent Technologies  707-577-3994  stan_bischof@agilent.com
--------------------------------------------------------------------------

---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes