Szorin79
Szorin79

Reputation: 1

WindowsCE Path to Copy file to pc

I am looking for the path of my connected Windows CE device in the Windows Manager under Windows 11. I would like to copy a file from Windows CE to Windows 11 in Python

here is the code:

import shutil
import subprocess

def copy_file_from_windows_ce(device_path, ce_file_path, destination_folder):
    try:
        # Construct the source path on the Windows CE device
        source_path = device_path + ce_file_path

        # Construct the destination path on the PC
        destination_path = os.path.join(destination_folder, os.path.basename(ce_file_path))

        # Copy the file
        shutil.copy2(source_path, destination_path)
        print(f"File copied successfully from Windows CE to PC.")

    except Exception as e:
        print(f"Error: {e}")

# Example usage:
device_path = **r"\FlashDisk"**  # Adjust this to the actual path on your Windows CE device
ce_file_path = **r"\path\to\your\file.txt"**  # Adjust this to the file path on your Windows CE device
destination_folder = r"C:\Your\Destination\Folder"  # Adjust this to your PC folder

copy_file_from_windows_ce(device_path, ce_file_path, destination_folder)

Thanks in advance

i tried chat gpt.....nothing

Upvotes: 0

Views: 81

Answers (0)

Related Questions