How can I access file on machine by address like \\a_machine\pub\list

Discussion in 'Perl Misc' started by Water Lin, Jan 12, 2009.

  1. Water Lin

    Water Lin Guest

    I need to access file under Windows XP. The path on the network is
    something like \\a_machine\pub\list

    I don't know what kind of this protocol is. And I don't know how I can
    access this folder by Perl.

    By the way, I am using Strawberry Perl under Windows XP.

    Anyone has experience about this?
     
    Water Lin, Jan 12, 2009
    #1
    1. Advertising

  2. Water Lin <> wrote:
    >I need to access file under Windows XP. The path on the network is
    >something like \\a_machine\pub\list
    >
    >I don't know what kind of this protocol is.


    SMB, see http://en.wikipedia.org/wiki/Server_Message_Block

    >And I don't know how I can access this folder by Perl.


    The easiest way is to assign a drive letter to the SMB share and then
    use standard Drive:/Path/Filename.ext notation. See "net help use" for
    details.

    jue
     
    Jürgen Exner, Jan 12, 2009
    #2
    1. Advertising

  3. Water Lin

    Water Lin Guest

    Re: How can I access file on machine by address like\\a_machine\pub\list

    On Jan 12, 4:15 pm, Jürgen Exner <> wrote:
    > Water Lin <> wrote:
    > >I need to access file under Windows XP. The path on the network is
    > >something like \\a_machine\pub\list

    >
    > >I don't know what kind of this protocol is.

    >
    > SMB, seehttp://en.wikipedia.org/wiki/Server_Message_Block
    >
    > >And I don't know how I can access this folder by Perl.

    >
    > The easiest way is to assign a drive letter to the SMB share and then
    > use standard Drive:/Path/Filename.ext notation. See "net help use" for
    > details.
    >
    > jue



    Yes, it works.

    But if I need to input password and username while I connect to this
    computer.

    Is there any good solution for this problem?

    Thanks
     
    Water Lin, Jan 13, 2009
    #3
  4. Re: How can I access file on machine by address like \\a_machine\pub\list

    Water Lin <> wrote:
    >On Jan 12, 4:15 pm, Jürgen Exner <> wrote:
    >> Water Lin <> wrote:
    >> >I need to access file under Windows XP. The path on the network is
    >> >something like \\a_machine\pub\list

    >>
    >> >I don't know what kind of this protocol is.

    >>
    >> SMB, seehttp://en.wikipedia.org/wiki/Server_Message_Block
    >>
    >> >And I don't know how I can access this folder by Perl.

    >>
    >> The easiest way is to assign a drive letter to the SMB share and then
    >> use standard Drive:/Path/Filename.ext notation. See "net help use" for
    >> details.

    >
    >But if I need to input password and username while I connect to this
    >computer.


    You need to _PASS_ username and password as argument to "net use ..."
    when attaching the share as a drive. That is different from entering a
    pwd.

    >Is there any good solution for this problem?


    That depends upon what "the problem" is.
    The most simple approach is to just include uid and pwd in the call to
    "net use ..." in the script. Of course that would be in clear text and
    therefore you need to make sure, that nobody but you has permissions to
    read or execute the script.
    Depending upon your situation this may or may not be enough security.
    Other approaches include e.g. storing the credentials in a separate,
    secured and/or encrypted file, providing the credentials manually upon
    starting the script, having a different script attaching the drive,
    attaching the drive manually and then running the automated script, ....

    jue
     
    Jürgen Exner, Jan 13, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. B.W.

    Adding Pub any other way?

    B.W., Oct 3, 2003, in forum: HTML
    Replies:
    3
    Views:
    339
    Jukka K. Korpela
    Oct 3, 2003
  2. Edd
    Replies:
    2
    Views:
    322
  3. Simon Wittber
    Replies:
    0
    Views:
    218
    Simon Wittber
    Aug 17, 2007
  4. Mike Hjorleifsson

    Paramiko SFTP autologon using id_dsa.pub

    Mike Hjorleifsson, Feb 6, 2008, in forum: Python
    Replies:
    7
    Views:
    845
    Michele Hjorleifsson
    Feb 14, 2008
  5. Steve Howell

    simple pub/sub

    Steve Howell, Jan 21, 2010, in forum: Python
    Replies:
    6
    Views:
    308
    bobicanprogram
    Jan 22, 2010
Loading...

Share This Page