How to recursively copy directory in Windows to impacket-smbserver Samba server running on Linux (Kali)?

  impacket, samba, windows

I am going through an exercise where I have a Samba server (impacket-smbserver) running on a Kali machine and I am trying to recursively copy an entire directory on a Windows 7 machine to the Kali to better navigate and disseminate files of interest. However when I run the command from the Windows box:

xcopy <src_directory> <remote-ip><share_name> I get "Access denied Unable to create directory" in Windows while on the Samba server I see SMB2_CREATE: <share_name>.,514,[Errno 21] Is a directory: '<share_path>/.'

The other alternative I tried was to add a non-existent directory name to the end of the xcopy command xcopy <src_directory> <remote-ip><share_name><new_dst_dir> and I get prompted with a message Does <ip><share_name><new_dst_dir> specify a file name or directory name on the target (F = file, D = directory)? but when I select ‘D’ for directory, a bunch of binary shows up and crashes the Windows machine. Is there something I’m missing or is there a better method of this method does not work?

Source: Windows Questions