12-09-2008 03:32 AM
I am trying to log the result of running the xcopy by command line, but not successful.
Any suggestion?
Please rename the attached xcopy.vi to xcopy.exe
Solved! Go to Solution.
12-09-2008 05:35 AM

12-09-2008 09:30 AM
For some reason, the command doesn't run properly if "Wait Until Completion" is set to True. If you use this:
cmd /c "XCopy /Y /E /F d:\test3\*.* d:\test4\" > c:\test.txt
as your command line it will create c:\test.txt which will have the info you are looking for.
Is tehre a reason you are not doing this directly in LabVIEW?
12-09-2008 09:32 AM - edited 12-09-2008 09:33 AM
It appears that you're not getting anything on the standard output when you run the xcopy command like that. Even preceding the command with "cmd /c" doesn't do anything. In addition to the above suggestion you can try the technique shown in this example.
EDIT: Ah, good catch with the wait until completion. Also, good question about why this is not being done using LabVIEW functions.
12-09-2008 09:53 AM
I guess this labview function should do the job![]()
Copy Function
Installed With: Base Package
Copies the file or directory that you specify in source path to the location that you specify in target path. If you copy a directory, this function copies all its contents recursively to the new location. This function does not work for files inside an LLB.

12-09-2008 10:07 AM
12-09-2008 10:49 AM
That is not correct Matthew. In this example I copy the dir C:\dell\contact to the new dir c:\test1. If C:\dell\conntact have subdirs they will also be copied

12-09-2008 11:09 AM
I wasn't saying the subdirectories wouldn't be copied. What I am saying is that there is a contact directory created in c:\test1 (assuming c:\test1 exists). So you get c:\test1\contact. If c:\test1 doesn't exist, then it doesn't create c:\test1\contact. The more intuitive way (at least to me) is to behave the same way and never create contact unless I specify that's where it should go. So, you get two different behaviors. The only way to correct for this is to do it yourself by listing the folder and copying the files individually.
Run your VI twice in a row starting with c:\test1 not existing.
12-09-2008 11:47 AM - edited 12-09-2008 11:56 AM
Maybe it is time for me to go home. The time is 18:30 her e in Norway. But anyway referring to my first example. If the dir c:\test1 do not exist it will be created, and the content of c:\dell\contact will be copied into c:\test1. But if the dir c:\test1 exists I will get an error (duplicate dir). On the other hand. if I want to copy the content in c:\dell\contact to c:\test1\contact I will get an error if c:\test1 does not exist
This was tested in 7.0

12-09-2008 12:06 PM