Solved

Rename a text file with VBA or a macro in access

Posted on 2006-11-08
5
1,323 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Creating and Managing Databases with phpMyAdmin in cPanel.
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…

791 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