Copy Files

Hello everybody

I need to copy all files from one path to another path…for example from c:\navision to c:\navision\history.

How can i do this? I can only copy one file each time…

Please help me.

Thanks

you can use XCOPY command using SHELL function.

Thanks Nuno

Can’t i use something like this:FILE.COPY?

I’m a beginner in Navision…

yes, you can also use.

f.RESET;
f.SETRANGE(Path, ‘c:’);
IF f.FIND(’-’) THEN
REPEAT
COPY(f.path + f.Name, ‘c:\navision\history’ + f.Name);
UNTIL f.NEXT = 0;

f is a Record of type File

Thank you Nuno.

It’s solved!!!

You may want to add the setting:

F.SETRANGE(“Is a file”,TRUE);

I also forget to mention that, if you have subfolders you will have problems.
Thanks Nicholas,

pardon me as i am new to NAV… where do i input the codes as indicated above?

In a Codeunit, Table, etc.
Depends a lot what you are trying to achieve.