Celeb Glow
general | March 28, 2026

Copy file with smbclient and path to directory

I'm stuck in NT_STATUS_BAD_NETWORK_NAME error but can't understand what I'm doing wrong.

My objective: copy a file from ubuntu to windows in a simple command line to be called by php.

The problem: when I add more than one folder to the path it throws the NT_STATUS_BAD_NETWORK_NAME error.

Example:

smbclient -U someuser%somepassword //10.0.1.250/Home/Public/Offline -c 'put "test.deb"'
Domain=[FILESERVER] OS=[Windows Server 2012 Standard 9200] Server=[Windows Server 2012 Standard 6.2]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

But when I try just:

smbclient -U someuser%somepassword //10.0.1.250/Home

It connects and I can do a put with the same file:

smb: \> cd Public/Offline
smb: \Public\Offline\> put test.deb

So it not seems to be a permissions issue.

What could I doing wrong?

1 Answer

Try to use the initial directory option (--directory Public/Offline)

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy