Map a drive

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to map a drive to my web server at run time when a user clicks a link in my web application

Is there a namespace in VB.net to Map drives

Or
is there a Shell command which directly runs the command from the command prompt instead of running a EXE or a batch file

Does anybody have a method or code for this in VB.net

Please let me know

SKumar
 
map from the client? or from the server to another machine? If the first,
NO, if the second, why map? Just use UNC, but yes you can map them.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


skumar said:
I want to map a drive to my web server at run time when a user clicks a link in my web application.

Is there a namespace in VB.net to Map drives?

Or
is there a Shell command which directly runs the command from the command
prompt instead of running a EXE or a batch file?
 
May i please have a sample code of how to do this.

Using a namespace in .net??

or using shell command??

Can you let me know the code for this mapping. Also this is a web scenario. what permissions should we grant to ASP.net user for doing this??
 
skumar said:
May i please have a sample code of how to do this.

Using a namespace in .net??

or using shell command??

Can you let me know the code for this mapping. Also this is a web
scenario. what permissions should we grant to ASP.net user for doing this??

Mapping seems like a bad idea. Note that drives are mapped per users, so
they will be mapped as whoever your webapp is running as. Unless you are
doing impersonation, this is going to be the same user every time. You will
get an error if you try and map a drive already mapped. Of course your code
can check for this, but I can imagine a lot of concurrency problems. What
if one user has just mapped the drive, and the code checks and sees if it is
already mapped, but then the first users is finished and the drive is
unmapped, you will have problems. There are other problems too. If you are
using impersonation, what if that user is already using that drive letter?
Why not use the UNC as Curt suggested?

-John Oakes
 
Back
Top