DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Transfer Files On Windows Network

11.18.2005
| 5543 views |
  • submit to reddit
        From Fadly Tabrani's <a href=http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442521>recipe</a>.
You need his implementation of netcopy, netmove, netdelete.
pywin32 extension required.
# Copy "c:\documents" folder/file to "c:\transferred" on host "w0001".
netcopy('w0001', 'c:\\documents', 'c:\\transferred')

# Move with account credentials.
netmove('w0001', 'c:\\documents', 'c:\\transferred', 'admin', 'adminpass')

# Delete with another account.
netdelete('w0001', 'c:\\transferred', 'testdom\\user1', 'user1pass')