-1

I am trying to copy files from windows server to network shared folder via VPN . Here is my code from batch file. This is working fine without any issues.

net use \\servername\test_folder password /user:user_name
xcopy C:\Apache\htdocs\arul\xias \\servername\\test_folder

But when I try to run this from Linux machine it is not working. This Linux machine is also connected to network shared folder via VPN. So I tried below on Linux machine in .sh file.

net use \\servername\test_folder password /user:user_name
cp C:\Apache\htdocs\arul\xias \\servername\\test_folder

I am getting errors like net command is not found and cp: -r not specified;

How to achieve this from Linux machine ?

user3408779
  • 981
  • 2
  • 19
  • 43
  • [How to access mounted network drive on Windows Linux Subsystem?](https://superuser.com/q/1128634/173513), [How to access files on network drive from Windows Subsystem for Linux](https://superuser.com/q/1481954/173513), [Mounting network drive in Windows 10 bash?](https://superuser.com/q/1127418/173513) and friends. You should state what you have performed, and how it failed to work as expected. – jww Dec 02 '19 at 10:03

1 Answers1

0

The commands "net use" and "xcopy" are specific to Windows and will newer work on linux. You should use some smb specific commands instead (of course, the kernel must support them).

VillageTech
  • 1,968
  • 8
  • 18