Create shared folder in server

Enrique Palomo enrique.palomo at xgs-spain.com
Fri Nov 10 03:56:59 EST 2006


Hi all,
I'm doing some test to create and share  folders in another pc.
I'm executing an example found googling and works fine in my own pc, but
executing from another (ping is ok) raises an "access denied" error.
I've included the entry shinfo['user'], don't know if exist but is needed to
operate in different servers.
Any idea?

Thanks a lot
Enrique

import win32net
import win32netcon

shinfo={}

shinfo['netname']='prueba pitonera'
shinfo['type']=win32netcon.STYPE_DISKTREE
shinfo['remark']='bedrock_rubbel'
shinfo['permissions']=0
shinfo['max_uses']=-1
shinfo['current_uses']=0
shinfo['path']='c:\\xxxxxxxxxxxx'
shinfo['user']='xxxxxxxxxxxxxx'
shinfo['passwd']='xxxxxxxxxxxx'
server='xxxxxxxxxxxx'

try:
  win32net.NetShareAdd(server,2,shinfo)
except win32net.error:
  print
traceback.format_tb(sys.exc_info()[2]),'\n',sys.exc_type,'\n',sys.exc_value


**AVISO DE CONFIDENCIALIDAD**
La informacion contenida en este mensaje y archivos es privada y confidencial estando dirigida solamente al destinatario. Si Ud. ha recibido esta informacion por error, por favor, proceda a su inmediata destruccion. Cualquier opinion o punto de vista contenido en este mensaje corresponde al remitente y necesariamente no representa la opinion del GRUPO XEROX.

**CONFIDENTIAL HEADER**
This email and any files are private and confidential and intended solely for the use of the addressee(s). If you have received this e-mail in error please delete it immediately. Any views or opinions presented in this e-mail are solely those of the sender and do not necessarily represent those of XEROX GROUP.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20061110/80189c83/attachment.html>


More information about the Python-list mailing list