From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compare & Copy Paste file to folder

Dear all,

 

I'm trying to copy and paste a file to a folder with the same name. My idea is, I tried to make a comparison between the file name and the folder name and if the same it will be copied to the folder according to the name. I tried to make code for this idea but it didn't work.

 

I'm attaching pictures and files for your reference :

SofeaNur_0-1674636870952.png

Copy file

SofeaNur_1-1674636916257.png

 

 

 

 

 

 

 

 

 

 

 

Paste into this folder by name

 

0 Kudos
Message 1 of 2
(558 Views)

Hi Nur,

 


@SofeaNur wrote:

I'm trying to copy and paste a file to a folder with the same name. My idea is, I tried to make a comparison between the file name and the folder name and if the same it will be copied to the folder according to the name. I tried to make code for this idea but it didn't work.

 You need to provide a full filepath also for the destination of your copy operation! (It does not allow to copy a file as a folder…)

Use BuildPath also for the destination as yoou do for the source of the FileCopy function.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 2
(550 Views)