Lotusscript move files from one folder to another

I process a bunch of files on a shared drive and I need to move them to a sub-folder after that.How do I move them from one directory to another in LotusScript ?

TIA

Subject: Processing files

The way I see it, you have two options:

  1. Use the LS “FileCopy” statement to copy the file to the sub-folder, and then use the LS “Kill” statement to delete the original file. Example of FileCopy: FileCopy “E:\main\test.txt”, “E:\main\sub1\test.txt”

The “Kill” statement is easy: Kill “E:\main\test.txt”

(There are no wildcards allowed. It would have to be done in sequence).

  1. Since you’re doing this on a Windows 2003 server, it would also be possible for you to create a .BAT file on the fly, containing a Windows “MOVE” command, telling the operating system to do the work. Once you’ve written the file to disk, you could simply execute it using the LS “Shell” command. Example .BAT file named MOVEFILES.BAT:

MOVE E:\main*.txt E:\main\sub1.

Then, you’d do a: Shell “MOVEFILES.BAT”

The only drawback here is that the Shell command (in Windows) will return control after the command has been launched. Your script will continue to run without waiting to see if the program started by Shell has finished.

Subject: Kill doesn’t always work

Jack, thank you.I would rather try your second approach. The drawback shouldn’t make a difference in my case.

I already had a Kill statement, but Kill files doesn’t always work in my environment. That’s the reason I’d like to move them to a sub-folder.

Thanks again.

Subject: Kill vs. move

Gigi,

Am glad that my suggestion helped. Best of luck with it.

-Jack

Subject: Move the files to subfolders

Hi, I have the similar requirement in Notes migration where we store all the converted emails into shared drive first. And now we need to move each msg file into respective subfolder subfolders based on UniqID.ex:

From

C:\test.nsf\abcd124343535asgg124155.msg

To

C:\test.nsf\abcd124343535asgg124155\abcd124343535asgg124155.msg

The first option of using filecopy method works fine and I want to know few more details about the second option. Really appreciate your help on this. cheers!