Windows Process Can't Write to Samba Shared Drive

 

Problem: When logged into a Windows system, you can map a Samba share, create, delete, read, execute, etc., but when a Windows system process on the same Windows machine accesses the share, writes fail. Samba is set up to allow anonymous access, so it isn't a user/name password issue.

 

Solution: Windows services and processes should not use a mapped drive to access shares, they should use UNC. See MS KB 180362:

A service should not directly access local or network resources through mapped drive letters. Additionally, a service should not use the WNetXXXXXXX APIs to add, remove, or query any mapped drive letters. Although the WNetXXXXXXX APIs may return successfully, the results will be incorrect. A service (or any process that is running in a different security context) that must access a remote resource should use the Universal Naming Convention (UNC) name to access the resource. UNC names do not suffer from the limitations described in this article.

 

Keywords: Windows service samba writes fail. Windows Process Can't Write to Samba Shared Drive.