Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Creating A Share On Windows

DZone's Guide to

Creating A Share On Windows

·
Free Resource
Copied from John Nielson's recipe.

import win32net
import win32netcon

shinfo={}

shinfo['netname']='python test'
shinfo['type']=win32netcon.STYPE_DISKTREE
shinfo['remark']='data files'
shinfo['permissions']=0
shinfo['max_uses']=-1
shinfo['current_uses']=0
shinfo['path']='c:\\my_data'
shinfo['passwd']=''
server='servername'

win32net.NetShareAdd(server,2,shinfo)
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}