Передача файлов через RDP соединение - PullRequest
0 голосов
/ 21 июня 2019

Попытка скопировать файлы с удаленного рабочего стола на мой локальный.Вот код, который пытался ...

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 здесь ...

1 Ответ

0 голосов
/ 21 июня 2019

Вы используете клиент RDP? Это Windows Linux или Mac? Какое приложение вы используете? Это код, который вы написали? Вы знаете, что такое виртуальные каналы? NLA включен? Существует очень мало информации, которую вы предоставили. ты вообще можешь подключиться? Можете ли вы пинговать сервер?

...