• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1347
  • Last Modified:

Rename a text file with VBA or a macro in access

How can I use MS Access to rename a file in another folder?

I have a file...  c:\test\file.txt
I want to use Access to rename it (like the ren function in DOS) to c:\test\NEW.txt

How can I do this? Can I do this? Will Britney ever find love again?
0
niner
Asked:
niner
  • 2
  • 2
1 Solution
 
hongjunCommented:
You can do this


FileCopy C:\test\file.txt, C:\test\NEW.txt
Kill C:\test\file.txt
0
 
ninerAuthor Commented:
How/where, in VBA?
0
 
hongjunCommented:
Yes. in VBA
0
 
MrNeticCommented:
That's pure VBSCRIPT, you can do as HonJun says .



Best Regards,

Paulo Conde├ža.
0
 
ninerAuthor Commented:
Ah, I got it. Can this be extrapolated to like *.txt or does the first filename need to be explicit?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now