By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 1,607 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

Unshared folder access.

P: n/a
Hello all. I have a program that manages (delete, copy, open, etc) several
files inside a shared folder in a server, but the users some times use the
Windows Explorer to open and work with files, I do not want it, because my
program opens the files and store some data in a SQL database, so, if the
users open the files with Windows Explorer, my databse is not updated.
If I unshare this folder, in order to eliminate the access with Win
Explorer, how can I access with my program? I mean, my program has to read,
copy, delete, etc. files inside an unshared folder.

Thanks in advance,
William GS
Mar 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> Hello all. I have a program that manages (delete, copy, open, etc) several
files inside a shared folder in a server, but the users some times use the
Windows Explorer to open and work with files, I do not want it, because my
program opens the files and store some data in a SQL database, so, if the
users open the files with Windows Explorer, my databse is not updated.
If I unshare this folder, in order to eliminate the access with Win
Explorer, how can I access with my program? I mean, my program has to
read,
copy, delete, etc. files inside an unshared folder.


What you could do is use impersonation.
I.e. your app changes its security context to a special user that is the
only user that has privileges on that share. That user has to be allowed to
update the folder.

That way regular users cannot modify the share, but only your user (your
program) can.
www.codeproject.com has several articles on impersonation. one of them is
this:
http://www.codeproject.com/csharp/cpimpersonation1.asp
it is for C#, but if you are using C++/CLI or MC++ you can easily translate
it.

Another way would be to user RPC, or to write a service on your server that
listens to commands from your app, and then performs the action. Those
solutions require some more programming, but you don't need the share
anymore.

--
Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
Mar 19 '06 #2

P: n/a
Bruno, thank you so much for your help.

William GS
"Bruno van Dooren" wrote:
What you could do is use impersonation.
I.e. your app changes its security context to a special user that is the
only user that has privileges on that share. That user has to be allowed to
update the folder.

That way regular users cannot modify the share, but only your user (your
program) can.
www.codeproject.com has several articles on impersonation. one of them is
this:
http://www.codeproject.com/csharp/cpimpersonation1.asp
it is for C#, but if you are using C++/CLI or MC++ you can easily translate
it.

Another way would be to user RPC, or to write a service on your server that
listens to commands from your app, and then performs the action. Those
solutions require some more programming, but you don't need the share
anymore.

--
Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"

Mar 19 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.