This is really beginning to get on my nerves, so I thought I'd throw it open to everyone and see what you all came up with...
I am trying to write a function meeting the following criteria:
* Moves a specific file to another location (might be different drive or network), and then
* Moves any other files matching an expression containing a wildcard into the same destination.
The logic of the function, playing with the path strings etc isn't an issue - that's all done.
My first approach was to work with the movefile method of the file system object, which worked fine most of the time, but raised Automation errors on one specific box in a managers office. (This problem was also in evidence at other points in the code that made use of FileSystemObject).
I've now had instructions from the powers that be that I am to remove all FileSystemObjects from our project - which is causing me problems when I try to do a move with wildcards.
At the moment, I am considering writing the function so that it makes use of dir() to identify the files which need to be moved, using FileCopy to actually move them, and then killing the originals by using setattr to deal with any read only flag and then putting them though a Kill Statement.
Does anyone have any better ideas?
mmilan.
Ps. I'm prepared to consider API, but the calls must be supported in everything from win95 up.
Thanks in anticipation...
I am trying to write a function meeting the following criteria:
* Moves a specific file to another location (might be different drive or network), and then
* Moves any other files matching an expression containing a wildcard into the same destination.
The logic of the function, playing with the path strings etc isn't an issue - that's all done.
My first approach was to work with the movefile method of the file system object, which worked fine most of the time, but raised Automation errors on one specific box in a managers office. (This problem was also in evidence at other points in the code that made use of FileSystemObject).
I've now had instructions from the powers that be that I am to remove all FileSystemObjects from our project - which is causing me problems when I try to do a move with wildcards.
At the moment, I am considering writing the function so that it makes use of dir() to identify the files which need to be moved, using FileCopy to actually move them, and then killing the originals by using setattr to deal with any read only flag and then putting them though a Kill Statement.
Does anyone have any better ideas?
mmilan.
Ps. I'm prepared to consider API, but the calls must be supported in everything from win95 up.
Thanks in anticipation...