Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello All, Does anyone know how to map a Windows network drive via a perl script?

Replies are listed 'Best First'.
Re: How do I Map Windows Network Drive
by atopolc (Pilgrim) on May 31, 2002 at 16:32 UTC
    According to the Learning Perl on Win32 system book. You can use Win32::NetResource
    You need to use the addConnection function. Follow the link to see the documentation.
      Thank you!
Re: How do I Map Windows Network Drive
by newrisedesigns (Curate) on May 31, 2002 at 17:06 UTC

    You can also do this with a system call to the NET command.

    system("NET USE driveLetter \\\\Path\\to\\resource");

    Use double backslashes if you use double quotes in the system call. ( \\ = \ )

    There are also many other NET functions, you can get a list by typing "NET HELP" at the command prompt.

    And remember to taint/untaint!

    John J Reiser
    newrisedesigns.com