Protect a folder

How can only my program access a specified folder on WinNT, 2000 and XP ??
SalvaThorAsked:
Who is Participating?
 
puranik_pCommented:
You can protect the folder using

 Netapi32.lib, Svrapi.lib & Netapi32.dll. Svrapi.dll

These liabraries exports the function to set and delete the shares and security for a perticular directory.

You can brows through this:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/stgmgmt/fs/netsharedel.asp
0
 
puranik_pCommented:
you want to protect the folder as long as your program is running?
Or you want that folder to be protected for that program forever (even when the program is not executing) ?
 
0
 
SalvaThorAuthor Commented:
Yes, I only want to protect the folder as long as my program is running.
0
 
SalvaThorAuthor Commented:
I want to protect my folder when my app is running only and
only "administrator" account can access or see it, but the
current user don't.

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.