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

W

Water Lin

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?
 
J

Jürgen Exner

Water Lin said:
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
 
W

Water Lin

SMB, seehttp://en.wikipedia.org/wiki/Server_Message_Block


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
 
J

Jürgen Exner

Water Lin said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top