正在尝试将文件从远程桌面复制到本地。这是一段尝试...
import os
import os.path
import shutil
import sys
import win32wnet
def netcopy(host, source, dest_dir, username=None, password=None, move=False):
""" Copies files or directories to a remote computer. """
wnet_connect(host, username, password)
dest_dir = covert_unc(host, dest_dir)
# Pad a backslash to the destination directory if not provided.
if not dest_dir[len(dest_dir) - 1] == '\\':
dest_dir = ''.join([dest_dir, '\\'])
# Create the destination dir if its not there.
if not os.path.exists(dest_dir):
os.makedirs(dest_dir)
else:
# Create a directory anyway if file exists so as to raise an error.
if not os.path.isdir(dest_dir):
os.makedirs(dest_dir)
if move:
shutil.move(source, dest_dir)
else:
shutil.copy(source, dest_dir)试图弄清楚如何建立连接并将文件复制到我的本地。这里是python的新手。
发布于 2019-06-22 02:32:47
您是否在使用RDP客户端?这是windows linux还是mac?您使用的是哪个应用程序?这是你写的代码吗?你知道什么是虚拟频道吗?NLA开启了吗?THere是您提供的很少的信息。你能连接上吗?你能ping通服务器吗?
https://stackoverflow.com/questions/56708677
复制相似问题