Shared Drive access 
Author Message
 Shared Drive access

My VB.NET application uses files located on the server. I do not want the
user to open or even to see those files outside of my application. How can I
access those files from my app. For now I run *.cmd  file which establishes
Virtual Private Network and maps the server drive on workstation. Files on
that drive are ready for use. But since I made this drive available for
application it is also available for the direct user access. I would like to
prevent it. How can I do that?
Thank you
Vlad


Thu, 20 Oct 2005 07:16:35 GMT  
 Shared Drive access
One of the ways to do this would be to create a share on the fly in your
application
for the folder where the required files are located whenever you need to
access those
files. This can be accomplished using WMI. However, the process requires to
connect
to the server which means you would have to hard code the server machines
password
into the application code. Another issue is the speed - if you have to
access your files
several times within the application, you might have to do this time and
again. You could
try to keep the share till the application is being run and delete the share
when the user
exits the application. The down side is that the files are accessible
atleast as long as the
application is running.
Another way would be to dynamically set the permissions of the folder within
your code.
You grant access to the folder to the user running your application on the
fly within your
code and reset the permissions when the user exits. But it still suffers
from the same flaw
as the above method. You can either set the permissions using WMI or you
could use
setACL.exe (freeware available at http://www.helge.mynetcologne.de/setacl/)
to
accoomplish that. You might still need to logon to your server from within
your code
using WMI.

Hope this helps,
Imran.


Quote:
> My VB.NET application uses files located on the server. I do not want the
> user to open or even to see those files outside of my application. How can
I
> access those files from my app. For now I run *.cmd  file which
establishes
> Virtual Private Network and maps the server drive on workstation. Files on
> that drive are ready for use. But since I made this drive available for
> application it is also available for the direct user access. I would like
to
> prevent it. How can I do that?
> Thank you
> Vlad



Thu, 20 Oct 2005 07:48:50 GMT  
 Shared Drive access
Imran,
Thank you.
Although I'm not familiar with WMI I used first 2 approaches and do not like
that user can access files while my app is running. The last approach I'm
going to try right now.
BTW, what is WMI? Where can I read about it?
Vlad


Quote:
> One of the ways to do this would be to create a share on the fly in your
> application
> for the folder where the required files are located whenever you need to
> access those
> files. This can be accomplished using WMI. However, the process requires
to
> connect
> to the server which means you would have to hard code the server machines
> password
> into the application code. Another issue is the speed - if you have to
> access your files
> several times within the application, you might have to do this time and
> again. You could
> try to keep the share till the application is being run and delete the
share
> when the user
> exits the application. The down side is that the files are accessible
> atleast as long as the
> application is running.
> Another way would be to dynamically set the permissions of the folder
within
> your code.
> You grant access to the folder to the user running your application on the
> fly within your
> code and reset the permissions when the user exits. But it still suffers
> from the same flaw
> as the above method. You can either set the permissions using WMI or you
> could use
> setACL.exe (freeware available at

http://www.helge.mynetcologne.de/setacl/)

- Show quoted text -

Quote:
> to
> accoomplish that. You might still need to logon to your server from within
> your code
> using WMI.

> Hope this helps,
> Imran.



> > My VB.NET application uses files located on the server. I do not want
the
> > user to open or even to see those files outside of my application. How
can
> I
> > access those files from my app. For now I run *.cmd  file which
> establishes
> > Virtual Private Network and maps the server drive on workstation. Files
on
> > that drive are ready for use. But since I made this drive available for
> > application it is also available for the direct user access. I would
like
> to
> > prevent it. How can I do that?
> > Thank you
> > Vlad



Thu, 20 Oct 2005 08:02:58 GMT  
 Shared Drive access
WMI - Windows Management Instrumentation

Microsoft Scripting Center:
http://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?co...
=28001169
(contains WMI Scripting primers)

Microsoft's WMI SDK:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmis...
wmi_start_page.asp

It might be slightly intimidating at first - but is really helpful
otherwise.
You might try using setACL.exe if you're really planning to set permissions
on the folder. Its a
great utility.

Happy to help,
Imran.


Quote:
> Imran,
> Thank you.
> Although I'm not familiar with WMI I used first 2 approaches and do not
like
> that user can access files while my app is running. The last approach I'm
> going to try right now.
> BTW, what is WMI? Where can I read about it?
> Vlad



> > One of the ways to do this would be to create a share on the fly in your
> > application
> > for the folder where the required files are located whenever you need to
> > access those
> > files. This can be accomplished using WMI. However, the process requires
> to
> > connect
> > to the server which means you would have to hard code the server
machines
> > password
> > into the application code. Another issue is the speed - if you have to
> > access your files
> > several times within the application, you might have to do this time and
> > again. You could
> > try to keep the share till the application is being run and delete the
> share
> > when the user
> > exits the application. The down side is that the files are accessible
> > atleast as long as the
> > application is running.
> > Another way would be to dynamically set the permissions of the folder
> within
> > your code.
> > You grant access to the folder to the user running your application on
the
> > fly within your
> > code and reset the permissions when the user exits. But it still suffers
> > from the same flaw
> > as the above method. You can either set the permissions using WMI or you
> > could use
> > setACL.exe (freeware available at
> http://www.helge.mynetcologne.de/setacl/)
> > to
> > accoomplish that. You might still need to logon to your server from
within
> > your code
> > using WMI.

> > Hope this helps,
> > Imran.



> > > My VB.NET application uses files located on the server. I do not want
> the
> > > user to open or even to see those files outside of my application. How
> can
> > I
> > > access those files from my app. For now I run *.cmd  file which
> > establishes
> > > Virtual Private Network and maps the server drive on workstation.
Files
> on
> > > that drive are ready for use. But since I made this drive available
for
> > > application it is also available for the direct user access. I would
> like
> > to
> > > prevent it. How can I do that?
> > > Thank you
> > > Vlad



Thu, 20 Oct 2005 08:18:36 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Network / Shared Drive Access

2. Need help copying files from shared drive to local drive

3. Set shared access on drive

4. How to chage access permission on shared drives

5. local drive letter <> drive share name

6. Template on a shared drive

7. Uploading a Template to the Shared Network Drive

8. What is the Share-Name of a local drive

9. What is the Share-Name of a local drive

10. What is network share name of local drive

11. security on shared drives

12. Strange behaviors with FoxPro DB and shared drives

 

 
Powered by phpBB® Forum Software