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?
CopyFile documentation
Moderators: Dorian (MJT support), JRL
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: CopyFile documentation
Perhaps add a switch to allow Win10 long path:
https://docs.microsoft.com/en-us/window ... ing-a-file
https://docs.microsoft.com/en-us/window ... limitation
https://docs.microsoft.com/en-us/window ... ing-a-file
https://docs.microsoft.com/en-us/window ... limitation
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: CopyFile documentation
Have passed this on.
Yes, we have a Custom Scripting Service. Message me or go here
- Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
- Contact:
Re: CopyFile documentation
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.
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.