Solved

Rename a text file with VBA or a macro in access

Posted on 2006-11-08
5
1,299 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
Comment Utility
You can do this


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

Author Comment

by:niner
Comment Utility
How/where, in VBA?
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Yes. in VBA
0
 
LVL 5

Expert Comment

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



Best Regards,

Paulo Condeça.
0
 

Author Comment

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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now