Can not copy files between Finder and Microsoft Remote desktop

Hi,


I have just gotten my first Macbook (Air M1) and wow what a experience!


I can not copy a file or files from a remote Windows 10 PC connected through Microsoft Remote desktop MacOS app.


I tried to copy and paste it into Finder > Download folder but get error code 43.


However I can copy folders but the files inside that copied folder will not be copied.


Is this possible in MacOS 11.0.1 ?

MacBook

Posted on Dec 9, 2020 2:38 PM

Reply
5 replies

Dec 15, 2020 9:15 AM in response to VikingOSX

Had some time to experiment, and came up with this AppleScript/Objective-C solution that will take the file:/// as shown on your clipboard, and copy it to your Downloads folder as the same filename (without the percent encoding. The caveat is that the location of the file as your example shows, may not let you access the Word document without elevated privileges, something this AppleScript does not provide.


Copy and paste into the Script Editor, click compile, and when you are certain you have a file on the clipboard as shown previously, then run the script. It does some error checking to ensure their is a file reference on the clipboard.


use framework "Foundation"
use scripting additions

property NSPasteboard : a reference to current application's NSPasteboard
property NSFileManager : a reference to current application's NSFileManager
property NSURL : a reference to current application's NSURL
property dialog_title : "Clipboard File Copy"

set pb to NSPasteboard's generalPasteboard()
set cliptxt to (pb's stringForType:(current application's NSPasteboardTypeString)) as text
if not cliptxt = missing value then
	log cliptxt as text
end if

if cliptxt does not start with "file:///" then
	display dialog "File URL format not on clipboard… quitting." with title dialog_title
	return
end if

set theFile to NSURL's URLWithString:cliptxt
set fileURLstatus to (theFile's absoluteURL)'s fileURL

if fileURLstatus then
	
	set fm to NSFileManager's defaultManager()
	set fname to theFile's lastPathComponent()
	set userhome to (fm's homeDirectoryForCurrentUser)'s URLByAppendingPathComponent:"Downloads"
	set destpath to userhome's URLByAppendingPathComponent:fname
	set status to fm's copyItemAtURL:theFile toURL:destpath |error|:(reference)
	if (item 1 of status) then -- true is successful file copy result
		display dialog "Written to destination: " & return & return & destpath with title dialog_title
	else
		display dialog "Failed to write/overwrite existing destination file: " & return & return & destpath with title dialog_title
	end if
else
	display dialog "No file on the clipboard" with title dialog_title
end if
return


Tested on Big Sur 11.1.

Dec 15, 2020 5:44 AM in response to Ppedersen85

Two things that I observe are that 1) I don't believe that Finder knows how to copy file URL (with UNIX paths) to other Finder filesystem locations, and 2) does not know what to do with percent encoded paths (e.g. fra%20rdp.docx, which is fra rdp.docx).


Either Microsoft does not have support for copy/paste in RDC, conceals the capability in its Preferences, or has not thought out how Finder handles files. Perhaps it will support drag and drop from the Windows interface, directly to your Downloads folder.


For non-Norwegian speakers, your error dialog states:


The operation cannot be completed because one or more of the objects were not found. (Error code -43)

Dec 14, 2020 10:08 AM in response to Ppedersen85

Hello Ppedersen85,


Welcome to the Apple Support Communities, and from your post it appears on the MacBook Air there are issues using a specific function in Microsoft's Remote Desktop app. We'll do what we can to help or point you to the right place.


According to Microsoft's website, the Mac currently doesn't have the option for the app, only iOS devices: How to use Remote Desktop


If you are running the iOS version using the new M1 feature, just remember that some features might not be able to be utilized while running under Mac. It'll be best to reach out to the developer of the app to be sure: Contact Us - Microsoft Support


Thanks and have a wonderful day.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can not copy files between Finder and Microsoft Remote desktop

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.