Copy file to a hidden folder overwrite or remove original

I need to copy the same file, “boot.efi” into two specific folders to allow my old Mac Pro 1.1 to run Yosemite. I can copy one file into /System Folder/Library/Core Services using this script

set filesToMove to choose file  -- finds the "boot.efi" file
set destinationFolder to choose folder-- can this be replaced with a path /System Folder/Library/Core Services ?
tell application "Finder"
	duplicate file filesToMove to folder destinationFolder with replacing
end tell

The other folder is hidden and the file to replace is locked. How can I copy the selected file into /usr/standalone/i386, and overwrite or remove the file that is there.

Also since the destination folders are known how can I address them directly without having to use
set destinationFolder to choose folder

Model: Mac Pro 1.1
AppleScript: Version 2.7 (176)
Browser: Safari 600.2.5
Operating System: Mac OS X (10.2.x)


You can always use the unix cp command , to copy the file to wherever you want. Personally, I don’t touch anything inside the System folder, so use this on your own risk.

The snippet below lets a command be executed as root. I use this, when I need to do stuff as root, as then I don’t have to have administrator privileges on my primary account. :slight_smile: This effectively works as running sudo from the terminal, if you have a root account enabled.

set curUser to (do shell script "who am i" with administrator privileges)
log curUser
set destinationFile to (POSIX file "/System/Library/CoreServices") as alias

set destinationFile2 to (POSIX file "/usr/standalone/i386") as alias

Yvan KOENIG (VALLAURIS, France) samedi 31 janvier 2015 21:28:22