I have a smb share on a Linux box set up that I can view in explorer:
\\XXX.YYY.ZZZ.QQQ\Share
In this share is a batch file:
\\XXX.YYY.ZZZ.QQQ\Share\Scripts\Script.bat
I can open the file in Notepad from Explorer, using right-click "Edit", and even edit the file.
If I double click on the batch file in explorer, or if I have a shortcut to the file on the desktop, I'm initially prompted with a "Open File - Security Warning", but when I click "Run" I get an error message:
Network Error
Windows cannot access \\\\XXX.YYY.ZZZ.QQQ\Share\Scripts\Script.bat
You do not have permission to access \\\\XXX.YYY.ZZZ.QQQ\Share\Scripts\Script.bat.
Contact your network administrator to request access.
The odd thing is that if I open a cmd
window and simply type "\\\\XXX.YYY.ZZZ.QQQ\Share\Scripts\Script.bat"
the script runs with no problems.
Starting with Samba 4 the execute permissions on files is enforced. The old behaviour with windows clients was to allow execution regardless. Windows actually opens the file slightly differently if it is executing it vs. just reading it - which is why you can print the file without any issues.
Either set execute permissions on the file or add this option to the share:
That will restore the old behaviour of allowing any executable to run.
See this bug report for more details.