Re: copy file over LAN



En Thu, 27 Mar 2008 00:34:20 -0300, Astan Chee <stanc@xxxxxxxxx> escribió:

I have a file on another machine on the local network (my machine and
local machines are on windows) and I want to copy it locally. Now the
machine requires authentication and when I try to do a
import shutil
shutil.copy(r'\\remotemachine\c$\temp\filename',r'C:\folder\test.txt')
and it gives me a IOError: [Errno 13] Permission denied: error, which I
expect. How do I provide authentication to copy this file?

Probably there are other ways, but the "net use" command looks easy enough. Execute "net help use | more" in a console to see the right syntax.
Use the subprocess module to run the command from inside Python.

--
Gabriel Genellina

.



Relevant Pages

  • Re: copy file over LAN
    ... local machines are on windows) and I want tocopyit locally. ... import shutil ... How do I provide authentication tocopythisfile? ...
    (comp.lang.python)
  • Re: copy file over LAN
    ... local machines are on windows) and I want tocopyit locally. ... import shutil ... How do I provide authentication tocopythisfile? ...
    (comp.lang.python)
  • Re: Change in ASP.Net authentication between Win2000 and Win2003
    ... > is turning on/off Kerberos is occuring. ... It control how IE deals with "Authentication: ... when you put IIS6 in a domain and have "Integrated Windows Authentication" ...
    (microsoft.public.windows.server.security)
  • Re: Change in ASP.Net authentication between Win2000 and Win2003
    ... > is turning on/off Kerberos is occuring. ... It control how IE deals with "Authentication: ... when you put IIS6 in a domain and have "Integrated Windows Authentication" ...
    (microsoft.public.inetserver.iis.security)
  • Re: Need help configuring Wireless Connection profile
    ... and I can only use the intel OR windows utility, not both at the same time. ... Windows authentication for all users,4129,LRG\ryanv,4149,Wireless WPA2 ... SMALL BUSINESS SERVER: ... STEP #1 Install Certificate Services ...
    (microsoft.public.windowsxp.general)