cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
djhanson
Level V

Copy File() - network dest doesn't work

Any reason why the below example won't work?  I get zero for the return, which means the file didn't copy and I can see that it didn't copy.  I can manually copy it fine via Windows 10. 

 

Question: does JSL File Copy() not like UNC (I think) network destinations perhaps?  

 

Copy File(
    "\\mywork1.work.com\folder1\source\test1.csv",
    "\\mywork2.work.com\folder2\dest\test1.csv"
);

 

File Copy() seems to work fine elsewhere, even if the source is a UNC network path.

1 ACCEPTED SOLUTION

Accepted Solutions
djhanson
Level V

Re: Copy File() - network dest doesn't work

Ok, I just discovered the fix.  In order to copy to a network dest (UNC), you must first delete the dest file if it already exists.

 

 

Delete File( "\\mywork2.work.com\folder2\dest\test1.csv" );

Copy File(
    "\\mywork1.work.com\folder1\source\test1.csv",
    "\\mywork2.work.com\folder2\dest\test1.csv"
);

 

 

If you don't first delete out any existing file, presumably as it has to overwrite it, it will not execute the copy.  I don't know if it's possible in the future to put a switch or variable in the Copy File() like overwrite ("Y" or "N").  That would make this a little more obvious probably.

View solution in original post

2 REPLIES 2
djhanson
Level V

Re: Copy File() - network dest doesn't work

* meant Copy File() here
djhanson
Level V

Re: Copy File() - network dest doesn't work

Ok, I just discovered the fix.  In order to copy to a network dest (UNC), you must first delete the dest file if it already exists.

 

 

Delete File( "\\mywork2.work.com\folder2\dest\test1.csv" );

Copy File(
    "\\mywork1.work.com\folder1\source\test1.csv",
    "\\mywork2.work.com\folder2\dest\test1.csv"
);

 

 

If you don't first delete out any existing file, presumably as it has to overwrite it, it will not execute the copy.  I don't know if it's possible in the future to put a switch or variable in the Copy File() like overwrite ("Y" or "N").  That would make this a little more obvious probably.

Recommended Articles