0

Is there a package in Python3, which can check if a windows directory is shared? and also to share a windows directory?

I am aware of using 'net share' command, I would like to know if there are is a pythonic way of doing it

Naks
  • 361
  • 3
  • 10

1 Answers1

0

For check and add, you could use NetShareCheck and NetShareAdd. And here is an sample to use netapi in python.

Or Use winapi SHGetFileInfo with SHGFI_ATTRIBUTES, then check the dwAttributes flag for SFGAO_SHARE.

You could create it with class Win32_Share and its Create method

import wmi
c = wmi.WMI()
c.Win32_Share().Create(args)
Drake Wu
  • 6,927
  • 1
  • 7
  • 30