LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Copying Files Using CommandLine?

Hi All

 

I am currently using XXCOPY to copy things from one file to another using commandline.

The problem is that it is illegal for me to use the Freeware Package for the my company.

The licensing is too expensive for XXCOPY and they force a person to be two.

Is a there another copier that is as fexiable as XXCOPY?

And that can do what i have done below ?

 

The following is what im currently using:

 

XXCOPY "M:\APPS\R&D\SOFTWARE New Structure" "M:\APPS\R&D\SOFTWARE Slave\" /EXCLUDE:"M:\APPS\R&D\SOFTWARE New Structure\exclude1.txt" /Y /oB2/oA"M:\APPS\R&D\SOFTWARE New Structure\Error Logs\Errors.log" /R/KD/E/Y/ZY/ED0/PB


XXCOPY "M:\APPS\R&D\SOFTWARE New Structure" "M:\APPS\R&D\SOFTWARE Slave\" /EXCLUDE:"M:\APPS\R&D\SOFTWARE New Structure\exclude2.txt" /IN:*.pdf /Y /oB2/oA"M:\APPS\R&D\SOFTWARE New Structure\Error Logs\Errors.log" /R/KD/E/Y/ZY/ED0/PB

 

I need to get this going as soon as possible.

Thanks

Help share your knowlegde
0 Kudos
Message 1 of 5
(2,931 Views)

Hi Shako,

 

Unfortunately LabWondows/CVI has no built in feature that allows you to copy things from one file to another using commandline.  Perhaps someone else on the forum will know of some 3rd party freeware.  However, if you would like to see this feature be implemented in future releases of CVI, feel free to create a suggestion on the NI Idea Exchange

Regards,

Hassan Atassi
Senior Group Manager, Digital Support
0 Kudos
Message 2 of 5
(2,898 Views)

I'm not sure what exactly you're trying to accomplish as I'm not familiar with XXCOPY, but it seems you might be able to write your own function in CVI using GetFirstFile() and GetNextFile() to loop through the files in the directories, and then conditionally move the files using CopyFile() followed by DeleteFile() (CVI does not include a move file function?) based upon your requirements.

 

Edit:  You can apparently move files in one step using RenameFile().

0 Kudos
Message 3 of 5
(2,895 Views)

I was thinking of using those functions.

But was not sure how to search in all folders and subfolders.

Could you please help me with this?

Help share your knowlegde
0 Kudos
Message 4 of 5
(2,862 Views)

I haven't done it, but it seems like it could work.  GetFirstFile() and GetNextFile() can find directories.  In order to know it's a directory, you can call GetFileAttrs(), as the return value specifies if the filepath is a file or directory.  Basically, the way I would do it is to create a function to copy the everything in a directory, where it would check each item as to if it is a file or a directory, and if it is a directory it would call itself recursively until it's finished.

0 Kudos
Message 5 of 5
(2,844 Views)