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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check file exists, copy, move, delete etc...

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
585
GB
Hello,

I need some method of checking a file exists and then copying it,
moving it and deleting the original source etc...

As I have not done much of this before I thought it wise to ask
the experts!

Reading about it seems that Fso seems a common way of doing these things.

Is this the best / most reliable approach?

As always many thanks for any advice.

Mark.
 

Hello,

You don't say what operating system you are running, but if using windows, then I would use Windows Explorer - navigate to the folder your files could be in, see if they are there, and do what you want.

Macs are fairly similar - Linux I don't know well enough to help.
 
I think the OP may be asking about programmatic access, rather than GUI browsing. And, given this is an Access forum, I think we can safely conclude the OS is Windows.
 
Sorry for clarity, I am using Windows 7 and Access 2013.

I am looking at determining a method for the following:

1. To check a folder exists.
2. To check a file exists
3. To copy a file to a new location and and rename the file.
4. To delete a file
5. To check weather a file is open
6. To check whether a file is read only.

Am I correct to think that if a file is open, it can not be
Copied or deleted?

Also if a file is read only, I think it has to be changed to
none read only before copying.

I "think" there are various approaches to this and was wondering how others
approach this. I want to achieve the above via vba.

Many thanks.

Regards Mark.
 
Most of the answers - if not all of them - you can find here :)

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 

"I think the OP may be asking about programmatic access, rather than GUI browsing. And, given this is an Access forum, I think we can safely conclude the OS is Windows. " by Strongman

My apologies, I misunderstood.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top