Solved

Rename a text file with VBA or a macro in access

Posted on 2006-11-08
5
1,319 Views
Last Modified: 2012-06-27
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
Comment
Question by:niner
  • 2
  • 2
5 Comments
 
LVL 33

Accepted Solution

by:
hongjun earned 50 total points
ID: 17899306
You can do this


FileCopy C:\test\file.txt, C:\test\NEW.txt
Kill C:\test\file.txt
0
 

Author Comment

by:niner
ID: 17899373
How/where, in VBA?
0
 
LVL 33

Expert Comment

by:hongjun
ID: 17899386
Yes. in VBA
0
 
LVL 5

Expert Comment

by:MrNetic
ID: 17899410
That's pure VBSCRIPT, you can do as HonJun says .



Best Regards,

Paulo Condeça.
0
 

Author Comment

by:niner
ID: 17899445
Ah, I got it. Can this be extrapolated to like *.txt or does the first filename need to be explicit?
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question