From: Brian Nicholson on
Hello,

I'm trying to create an admin page that can run miscellaneous scripts for
our IT department. Currently, I'm trying to create a script that can map a
network drive for a user (e.g. a form where I can input \\path\folder, drive
letter, and domain\user). Is this possible? If so, can someone point me in
the right direction?

Thank you,
Brian Nicholson
From: kimiraikkonen on
On Jun 29, 11:42 pm, Brian Nicholson
<BrianNichol...(a)discussions.microsoft.com> wrote:
> Hello,
>
> I'm trying to create an admin page that can run miscellaneous scripts for
> our IT department. Currently, I'm trying to create a script that can map a
> network drive for a user (e.g. a form where I can input \\path\folder, drive
> letter, and domain\user). Is this possible? If so, can someone point me in
> the right direction?
>
> Thank you,
> Brian Nicholson

Hi,
If you're meaning to transfer files across computers that are on the
same network, you can simply use it by calling mapped computer's name
with UNC path or network IP address:

My.Computer.Network.DownloadFile("\\MAPPED_PC\folder\file.exe",c:
\file.exe")

Additionaly, you need to set networkCredentials parameter if your
drives require network authentecation.

Hope this helps,

Onur Güzel
From: kimiraikkonen on
On Jun 30, 1:09 am, kimiraikkonen <kimiraikkone...(a)gmail.com> wrote:
> On Jun 29, 11:42 pm, Brian Nicholson
>
> <BrianNichol...(a)discussions.microsoft.com> wrote:
> > Hello,
>
> > I'm trying to create an admin page that can run miscellaneous scripts for
> > our IT department. Currently, I'm trying to create a script that can map a
> > network drive for a user (e.g. a form where I can input \\path\folder, drive
> > letter, and domain\user). Is this possible? If so, can someone point me in
> > the right direction?
>
> > Thank you,
> > Brian Nicholson
>
> Hi,
> If you're meaning to transfer files across computers that are on the
> same network, you can simply use it by calling mapped computer's name
> with UNC path or network IP address:
>
> My.Computer.Network.DownloadFile("\\MAPPED_PC\folder\file.exe",c:
> \file.exe")
>
> Additionaly, you need to set networkCredentials parameter if your
> drives require network authentecation.
>
> Hope this helps,
>
> Onur Güzel

However you can do it also with System.IO.File.Copy using UNC

and, correcting my previous syntax as:

My.Computer.Network.DownloadFile("\\MAPPEDPC\\file.exe","c:\file.exe")

or one of System.IO.File's methods to work with your mapped drive on
domain / workgroups using proper credentials.

HTH,

Onur G.
From: "Mr. Arnold" MR. on

"Brian Nicholson" <BrianNicholson(a)discussions.microsoft.com> wrote in
message news:2906FEFC-3E9A-4BAB-B0FA-9C3E339E516E(a)microsoft.com...
> Hello,
>
> I'm trying to create an admin page that can run miscellaneous scripts for
> our IT department. Currently, I'm trying to create a script that can map a
> network drive for a user (e.g. a form where I can input \\path\folder,
> drive
> letter, and domain\user). Is this possible? If so, can someone point me in
> the right direction?
>

As someone else said, you might not find a VB example, and as a good .Net
programmer, you need to know C# and VB. It's not that hard to translate.
There is no reason that you can't use the class for an ASP.Net solution.

There is also no reason you couldn't just take the class talked about as is,
compile as a C# dll, and set reference to the DLL and use it in your VB
project.

http://www.codeproject.com/KB/system/mapnetdrive.aspx

From: Brian Nicholson on
"Mr. Arnold" wrote:
>
> As someone else said, you might not find a VB example, and as a good .Net
> programmer, you need to know C# and VB. It's not that hard to translate.
> There is no reason that you can't use the class for an ASP.Net solution.
>
> There is also no reason you couldn't just take the class talked about as is,
> compile as a C# dll, and set reference to the DLL and use it in your VB
> project.
>
> http://www.codeproject.com/KB/system/mapnetdrive.aspx
>
>
Thank you for the response. I have no problems using C# code; I just asked
that initially because it's what I'm most familiar with. I've come across
that class before, but the problem is that it requires the password of the
user I'm mapping a network drive for. I was hoping there was some way I
could use IIS Windows Authentication or something similar to do this with an
account that has administrative rights, so I wouldn't be required to know the
user's password.