1

I want to access new drive of windows ex. 10.11.123.145 with username chaitanya and password 123@abc via python to copy some content from new drive to my macos desktop. How can I do this?

mount_smbfs "//chaitanya:123@[email protected]/folder_name" is not working. It gives nothing output.

I tried doing "open //chaitanya:123@abc@server/10.10.93.167" but then it is trying to open //167 and giving error. Thanks in advance for the help.

7
  • Does the command you show work in Terminal? I would recommend showing how you are attempting to use it within Python. Commented Jun 13, 2019 at 6:48
  • I am initially trying to do it in cmd. It is not working in cmd as well. After it works on cmd I will use os.system(command) in python. Commented Jun 13, 2019 at 6:55
  • So to clarify, you are attempting the command on Windows? Commented Jun 13, 2019 at 6:58
  • No, I am trying on mac os. When I try "open//chaitanya:123@abc@server/10.10.93.167" or "open //chaitanya:123@[email protected]", it is giving this error that it is trying to connect smb://167 and please check IP address. Commented Jun 13, 2019 at 7:00
  • 1
    By the way, there is no CMD on a Mac, you likely mean Terminal. Commented Jun 13, 2019 at 7:10

1 Answer 1

1

I believe the @ in your password is where things go wrong, so you'll probably want to encode it.

mount_smbfs //chaitanya:123%[email protected]/folder_name /existing_dir

Using %40 instead of @ in your password should let the command know where the real @ is.

You could probably also do:

mount_smbfs //chaitanya:123\@[email protected]/folder_name /existing_dir

Which escapes the @ in your password.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks for solution. But it is giving error 'no route to host' whereas i can connect to server via "Connect to server" option.
@Chaitanya: Is the Windows machine part of a domain or workgroup?
Yes. ch.lan is domain name. I tried using it as //ch.lan;.. but still getting same error.
@Chaitanya: Try doing mount_smbfs //'ch.lan;chaitanya:123\@abc'@10.11.123.145/folder_name /existing_dir - you might not need to escape the @ in this case because of the quotes around the domain;username:password.
I tried this but I am getting the error "Server connection failed: Unknown error -1". I don't know if this will help but I am trying to access from mac vm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.