CopyFile documentation

Ideas for new features & functions

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 1023
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

CopyFile documentation

Post by Grovkillen » Wed Dec 02, 2020 8:32 am

I ran into a problem when the copy file command returned CF_RESULT=True which is a success according to the help (https://www.mjtnet.com/manuals/v15/HTML/copyfile.html), no file was copied. The CF_RESULT_CODE was equal to 183 (0xB7) which told me that the MAX_PATH was exceeded. I think this should be mentioned in the help.

I guess the same goes for move file and rename file, perhaps also the folder commands?
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Grovkillen
Automation Wizard
Posts: 1023
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: CopyFile documentation

Post by Grovkillen » Wed Dec 02, 2020 9:24 am

Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Grovkillen
Automation Wizard
Posts: 1023
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: CopyFile documentation

Post by Grovkillen » Tue May 11, 2021 4:09 pm

Any input on this?
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1350
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: CopyFile documentation

Post by Dorian (MJT support) » Thu May 13, 2021 8:50 am

Have passed this on.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 1023
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: CopyFile documentation

Post by Grovkillen » Wed Apr 17, 2024 9:14 am

Bump on this.
Let>ME=%Script%

Running: 15.0.24
version history

robsmith
Newbie
Posts: 8
Joined: Mon Oct 30, 2023 2:12 pm
Location: USA

Re: CopyFile documentation

Post by robsmith » Sat Apr 20, 2024 2:16 am

I have had similar questions while debugging enough times that I now remember to lookup the decimal to hex conversion, to lookup the error meaning of the CF_RESULT_CODE decimal value on the Microsoft documentation page that is mentioned in the CopyFile documentation: https://learn.microsoft.com/en-us/windo ... operationa

I generally handle it with: If>{(%CF_RESULT%="True") AND (%CF_RESULT_CODE%="0")}

https://stackoverflow.com/questions/121 ... -filenames
From this link:
You should not be using this API for extremely long path names, it has been replaced in vista+ by IFileOperation interface

I suspect that the Microsoft suggestion of replacing SHFileOperation with IFileOperation is a large effort, and may it be better to implement a new command based on IFileOperation, to prevent breaking compatibility with older systems. https://learn.microsoft.com/en-us/windo ... eoperation

I'd love a switch to enable long paths too :-) not sure which would be more helpful.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts