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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can this be done using WNetAddConnection2?

Status
Not open for further replies.

silverspecv

Programmer
Joined
Oct 31, 2003
Messages
125
Location
US
I have a network shared directory with some files that I want to connect to. Now the trick is: I want the whole share to be shared as read-only for "everyone" but read-write when logged on as a certain special user. Then I want to write my program so that it operates as that user so that effectively, my program has read-write access. So far, it seems that connecting via this method sets the current windows credentials for that resource for my whole machine, not just the application. Thus if I "log in" with my program, I get read-write, at which point I can alt-tab to another app and use the temporary read-write persmissions. Is there a way to lock it down so that only my app has read-write?

PS, I would rather not map a drive letter. I would rather do all my file operations over the \\ name
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top