0

I am using python lib - Pathlib to access a file in the directory which requires Acc & Pwd.

Following is my current code:

FILE_PATH = "//192.168.10.1/Test/test.xlsx"
fileDir = pathlib.Path(FILE_PATH)
if (fileDir.exists() == False):
        print('File not found.')

I got this result:

[WinError 1326] The user name or password is incorrect: '\\\\192.168.10.1\Test\'

What if the login details are:

account: root, pwd: 123456

how should I revise the code so that I can access the file?

W Kenny
  • 1,855
  • 22
  • 33

2 Answers2

1

I hope you found a solution to your problem since it's seven months old ^^.

One way of fixing your issue is to use window's credential manager to save username and password for this connection.

Now I'm looking for a way of doing this only in python without using windows' workaround. If you had any luck in doing this I'm all ears ;)

Cheers.

Maxc
  • 11
  • 3
0

The way I did is join Domain. Then there is no login needed.

W Kenny
  • 1,855
  • 22
  • 33