Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


C# map network drive and printers on Vista and XP

Posted on 2009-04-24
Medium Priority
Last Modified: 2013-12-17

I worked on a small program that enable people who are not connected to our AD to map the drives they need

the program authinticate the user agains AD and then if the user is on the AD and the password is correct it map few drives

now I found some tool online help me with maping drives http://www.codeguru.com/csharp/csharp/cs_network/windowsservices/article.php/c12357

BUT is there any way to use a native .Net functions ?

for mapping network drives and printers ?

Question by:Data-Base
  • 2
LVL 75

Accepted Solution

käµfm³d   👽 earned 2000 total points
ID: 24232401
There is, to my knowledge, no native C# commands/libraries that allow you to map a drive. Your options include either using System.Diagnostics.Process.Start() to run a "net use" command, or use the Windows API or use the method you mentioned (which I'm sure uses one of the aforementioned methods).

Author Comment

ID: 24232993
Thanks for your reply,

which one is better ?

the API or the System.Diagnostics.Process.Start() and why

and does both run on Vista ?

Author Closing Comment

ID: 31574406
Thank you

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month15 days, 11 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question