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.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy a folder and all it's subfolders in Labwindows/CVI

I'm looking for ideas on how to copy a folder and all its subfolders.

 

My program creates test data organized using folders and subfolders.

At the end of the test I'd like to copy them to a backup drive.

How can I accomplish this?

 

Thanks,

Kirk

 

0 Kudos
Message 1 of 6
(4,155 Views)

Look at the multiple suggestions offered here in this recent post:

http://forums.ni.com/t5/LabWindows-CVI/copyfolder/td-p/1223586

0 Kudos
Message 2 of 6
(4,146 Views)

Thanks for the useful thread.

This sounds like a function to add to the Labwindows-CVI update "wish-list".

Kirk

0 Kudos
Message 3 of 6
(4,124 Views)

Hello,

I am sorry but the function CopyFile(,) seems not to work for me to copy folder containing subfolders and files.

CopyFile ("c:\\SourceDirName1\\*.*", "c:\\SourceDirName2");

The command copies however all files immediatly under SourceDirName1.

Has anyone ever experienced that stuff ?

Other suggestions for copying directories is welcomed.

I thried system(" XCOPY c:\\SourceDirName1 c:\\SourceDirName2  /e/y") it works well but display "the Dos console"

Thank you by advance.

 

 

0 Kudos
Message 4 of 6
(2,688 Views)

Have you looked at the following forum post?

https://forums.ni.com/t5/LabWindows-CVI/copyfolder/td-p/1223586

 

It may also help to create a new thread for your question as this thread is more than 8 years old. Making a new post will give it more visibility.

0 Kudos
Message 5 of 6
(2,672 Views)

Hello,

 

As you said, you can use the CMD xcopy with LaunchExecutableEx.

For example : LaunchExecutableEx("xcopy c:\\Source\\ c:\\Dest\\ /m /i /d:04-05-2019 /s /v /r /c /y",LE_HIDE, NULL);

will copy the files and subfolders of the day and will not open a Dos console with the option LE_HIDE.

 

Alain

0 Kudos
Message 6 of 6
(2,648 Views)