0

I am trying to share a directory with password and connect to it from another computer. i was trying to use NetUseAdd from win32net and the return value is None but when i try to open a file the error is: IOError: [Errno 13] Permission denied:

The code for connecting is:

use_dict={}
use_dict['remote'] = unicode('//servername/test')
use_dict['password']=unicode(password)
win32net.NetUseAdd(None, 2, use_dict)
file = open('//servername/test/file in the directory','rb')

and the code for sharing is:

dict={'netname': "test", 'type' : 0,'permissions' : 
                    1,'max_uses':-1,'path':directory, 'passwd': password } 

win32net.NetShareAdd(None,2,dict)

can u help me understand what the problem might be?

note: as written in the commments i ran both codes as admin

Or Vardi
  • 1
  • 3

0 Answers0