Use api or net use command to map drives?

  • Thread starter Thread starter Maulin Vasavada
  • Start date Start date
M

Maulin Vasavada

Hi,

I just want to map a drive to some shared folder. I have simple
requirements. I don't have login required for this mapped connection so
I was wondering should I just use "net use" via Process class?

I found,
http://www.codeproject.com/csharp/mapnetdrive.asp which seems pretty
neat but I was just wondering if I don't need the UI and some other
stuff from that API why to use it unncessary? I don't think I would
need those functionality in future as well.

Is there some obvious drawback of using the "net use" vs some API built
on mpr.dll??

Btw, I am using Windows 2000 if that matters in anyway.

Regards,
Maulin
 
Maulin Vasavada said:
Hi,

I just want to map a drive to some shared folder. I have simple
requirements. I don't have login required for this mapped connection so
I was wondering should I just use "net use" via Process class?

I found,
http://www.codeproject.com/csharp/mapnetdrive.asp which seems pretty
neat but I was just wondering if I don't need the UI and some other
stuff from that API why to use it unncessary? I don't think I would
need those functionality in future as well.

Is there some obvious drawback of using the "net use" vs some API built
on mpr.dll??

Btw, I am using Windows 2000 if that matters in anyway.

Regards,
Maulin

No, just stick to the command line utilities if you can. I would also
suggest to use UNC paths in your code instead of drive mapping.

Willy.
 
Back
Top