Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Runas for specific function

Status
Not open for further replies.

fortage

MIS
Jun 15, 2000
329
0
0
US
I'm new to C#.net and am attempting to wirte an app that will allow a user to take ownership of folders/subfolders and reset permissions on them. I would like the function that takes ownership to run as an account with admin writes. Is this possible? Any examples would be helpfu.
 
I would figure out how to do this via command line first. Once you can do it in commandline you can do it from C#.

Simply start a command line process and send the requested information to it.
 
I can use subinacls.exe and xcacls to do it from the command line but would prefer not shelling out.
 
Look up "Impersonation"

I use it to ensure my app (and only my app) can access files in a protected folder regardless of user.

I would post my code, but it is quite long.

You can probably find it all on the Internet, but I would be happy to email it to you, if you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top