Python Forum
access is denied error 5 for network drive mapping ? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: access is denied error 5 for network drive mapping ? (/thread-37953.html)



access is denied error 5 for network drive mapping ? - ahmedbarbary - Aug-13-2022

I working on script running on sql server 2019 using python 3.10 .

I have directory path \\192.168.7.9\Import\8 as mapped network drive and can
write and read to files and delete and create files on this directory path \\192.168.7.9\Import\8.

my issue when run script python on sql server 2019 it give me error 5 access is denied
but it must return true because directory path exist.

this path have permissions everyone and administrator and system full control read and write and delete .

EXEC sp_execute_external_script
@language =N'Python',
@script=N'
import os
result = os.system("net use S: \\\\192.168.7.9\\Import\\8")
print("result =", result)
d = os.path.isdir("S:")
print("d =", d)'



RE: access is denied error 5 for network drive mapping ? - ibreeden - Aug-14-2022

What happens if you open the Windows File Explorer and type "\\192.168.7.9\Import\8" in the address bar?
Remember you need to give permissons (on the server) both on the share and on the folder (and/or files). (Giving permissions on the top folder will do because permissions propagate down.)


RE: access is denied error 5 for network drive mapping ? - ahmedbarbary - Aug-17-2022

yes i can access this path from file explorer and write on it and read on it and delete from it .
also this server is 7.7 and i need to access server 7.9 from another server so are this way is correct