File move, rename in as few steps as possible
Hi guys,
I have a situation where I may need to move files owned by a user.
For example, user "fred" may own the following files in the "FR" directory:-
\FR\FRED44-010103-1947.ZIP
\FR\FRED44-010303-1143.ZIP
I may need to rename the user fred, which means his files have to be renamed and moved.
Example. User "FRED44" gets renamed to "SMITH67".
Therefore the files need to be renamed
SMITH67-010103-1947.ZIP
SMITH67-010303-1143.ZIP
and the files *moved* to the "SM" directory.
From where I see it, I would need to do this:-
1. Find all files that match "FRED44"
2. Copy all files to the "SM" directory
3. Rename the files "FRED44*.ZIP to "SMITH67*.ZIP"
4. Delete all the FRED44 files in the FR directory.
Is there a file management API that can do the above - move and rename - in one operation?
(No special reason for one operation - just efficiency).
Would that File API support the use of * as the renaming wildcard? As we know good old DOS supports *.
"XCOPY FRED44*.ZIP C:\SM\SMITH67*.ZIP"
Comments/code most welcome.
Thanks,
Mark
It's the little things...
OldName = "C:\MYDIR\OLDFILE": NewName = "C:\YOURDIR\NEWFILE"
Name Oldname as NewName
Moves the file and renames it...
Thanks for reading it though!
Mark