First of all: everything you will read in this post happens only if Windows 10 April 2018 update is installed. No problem be
Finally I found the problem: in the server with the shared folder, SMBv2 is disabled (I don't know why) so only SMBv1 is active; the same program executed from the same client in the same network but located on a server with SMBv2 enabled works fine.
So the problem is about SMBv1 share, deprecated starting from Windows 10 1803