Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fso move or replace

Status
Not open for further replies.

slabrat

Technical User
Feb 14, 2006
2
0
0
US
I am moving the oldest files in a directory using fso Move. This works very well but occassionally I have a file that already exists on the destination drive. Does fso move file have a move or replace command or switch? In checking for duplicates I have found it to be a fairly cumbersome ordeal unless I am doing it wrong? Help is appreciated

 
You could use FSO to check for the existence of the file in the destination folder. If it exists, you can use FSO to delete the file (assuming that's what you want to do).

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Use FSO's CopyFile (which you can force to overwrite the destination) rather than MoveFile, and then use DeleteFile to remove the source
 
strongm,

I considered giving that advice, but... If you move a file from one folder to another on the same drive, isn't it quicker than copying and deleting the source?

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top