Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

Restrict use of a network directory only while a program is running in windows

My software needs to read, and sometimes write files in a common directory in the network.
We have users type A and users type B. Users type A can write and read files in that directory, Users type B must only read in that directory but not write.
Outside my software, users should not read or write in that directory.
All users belong to the same domain.
I've tried to solve this with "net use X: ... " but it remains connected when my software ends and, while it is running, users can access drive X: so a batch file (with net use, MySoftware, net use /delete) is not a solution.
By the way, my software is developed using vb.net 2010.
Any idea to solve this?
0
BemboX
Asked:
BemboX
1 Solution
 
DaveCommented:
the classic solution would be client server, so you write a server app and connect using a pipe. otherwise you could have the program impersonate a second user e.g. "TYPEA" and "TYPEB" and set the share security appropriatly. details here:-

http://blogs.msdn.com/b/shawnfa/archive/2005/03/21/400088.aspx

http://williamfaulkner.co.uk/2009/04/vbnet-run-as-administrator-impersonate-a-user-2008/

or if you feel very brave just use hidden shares with "$" names and use UNC's not mappings in your program.

Have fun...
0
 
BemboXAuthor Commented:
Thanks a lot!!!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now