GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Copying Files to changes Owner Name? :S


I am having little bit of a problem here. I can copy folders and/or files but when I go to paste them in another location, the owner changes to me. I want to preserve the original owner.

These are the setting I have checked off

Any help would be great

If anything would change it it's turning on the copy security permissions option, but I think that only copies the permissions (ACLs) and not the ownership.

You can do it using the built-in Windows xcopy command with the /O switch. You will need to run it elevated (as Administrator) since non-admins cannot set file ownership. This Opus button takes care of all of that, elevating (via UAC) and then copying the selected items from source to destination:

(See How to add buttons from this forum to your toolbars.)

<?xml version="1.0"?> <button backcol="none" display="both" textcol="none"> <label>XCopy with permissions</label> <icon1>#copy</icon1> <function type="batch"> <instruction>@admin</instruction> <instruction>@leavedoswindowopen</instruction> <instruction>xcopy {filepath$|noterm} {destpath$}{file$} /O /X /E /H /K /I</instruction> </function> </button>

Thanks for the help, however, I am getting this error...

"Invalid number of parameters"...

screenshot attached..
thanks a lot of the help :opusicon:

Try this version:

<?xml version="1.0"?> <button backcol="none" display="both" textcol="none"> <label>XCopy with permissions</label> <icon1>#copy</icon1> <function type="batch"> <instruction>@admin</instruction> <instruction>@leavedoswindowopen</instruction> <instruction>@nofilenamequoting</instruction> <instruction>xcopy &quot;{filepath$|noterm}&quot; &quot;{destpath$}{file$}&quot; /O /X /E /H /K /I</instruction> </function> </button>

Hey Leo,

Now I am getting this error

You haven't followed the instructions on how to add the button properly. See the link in my post above.

This is the button I created:

I am copying files on Shared DRives.. May that be the problem?

Did you type/edit that by hand? The four " sequences should have turned into " characters when the text was pasted on to the toolbar (note: right-click the toolbar and select paste; do not paste anything into the button editor).

As far as I know it shouldn't matter with xcopy.

Hello Leo,

Now I did copy and paste the text. All i did was right click and paste. When I go to copy a file, after I select the folder to copy it to, I get this error... Sorry for all the trouble, this may get frustrating.

Please edit the command and where it says xcopy change it to echo then run it and post a screenshot of the result.

It should print out the arguments it was trying to send to xcopy so we can look at them and see what's going wrong.

Here it is, also send you a screenshot of the file and location

The ^ characters in the filenames may cause problems with DOS commands but, before we get to that, it looks like the elevated command prompt cannot see that drive at all.

Are you running as a separate non-admin user and elevating by typing in another account's credentials (rather than just clicking a button)? If so, I don't think the command-prompt will see the P: drive at all (well, depending on how it is mapped; if it's mapped for only your account then the admin account won't see it).

If you go to the same folder via its UNC path (\servername\share...) then it may work, unless the Administrator account you're using does not have access to the share.

When you try that, also try on some files that don't have ^ characters in their names to ensure that isn't causing extra problems.

I am working with VMWare, in a Isolated Environment. I am the adminsitrator.. I removed athe ^ but the same problem still occurs

If you type P: into the Admin command prompt window left after running the command, presumably it reports the same sort of error message?

However that drive is mounted, it cannot be seen by elevated processes. See if there's a different way to mount it. (Some programs call it "mount for all users" vs "mount for current user only".)

I would also search the VMWare forums for similar issues. (This rings a bell, actually... I seem to remember a similar problem in the past with the way VMWare mounts drives, though I may be confusing it with something else... Either way, the fact the admin command prompt (and all other admin processes) cannot see the drive is due to whatever has mounted the drive and not Opus.)