I have to rename approx 600 files with a prefix in a number of folders. what is the best way to do this?
surely opening the files and then saving the files with a new name will take too long ?
Is there a funky VB function that i can use to carry out this change to every file in chosen folders ?
It’s this or a lot of ……F2…..Home…..Ctrl+V……enter …….. repeat !
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
rename all files in folder (vb6 or vba)
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » rename all files in folder (vb6 or vba)
- This topic has 6 replies, 5 voices, and was last updated 23 years, 9 months ago.
AuthorTopicWSfatherjack
AskWoody LoungerAugust 7, 2001 at 12:01 pm #358842Viewing 3 reply threadsAuthorReplies-
WSVBNerd
AskWoody Lounger -
WSAndrew Cronnolly
AskWoody Lounger -
WSfatherjack
AskWoody Lounger
-
WSRuff_Hi
AskWoody LoungerAugust 7, 2001 at 3:16 pm #536402try …
Dim i As Integer
Dim fso As Object
Dim lsFileName As String
Dim lvFile As Variant
Dim lsPath As String
Dim lsNewFileName As StringSet fso = CreateObject(“Scripting.FileSystemObject”)
lsPath = “C:Directory
lsFileName = Dir(lsPath & “*.*”)
If Not lsFileName = “” Then
lsNewFileName = ‘formula based renaming method’ End IfDo Until lsFileName = “” ‘ get the file and copy it
Set lvFile = fso.getfile(lsPath & lsFileName)‘ rename file
lvFile.Name = lsNewFileName‘ get next file name
lsFileName = Dir
If Not lsFileName = “” Then
lsNewFileName = ‘formula based renaming method’
End If
LoopWSjscher2000
AskWoody LoungerAugust 7, 2001 at 8:54 pm #536446I have adopted a file naming convention for my group where we name files with the data at the beginning, such as “99-01-01 blah.doc”. This created an interesting “Y2K” problem for me, since I wanted the 99 files to sort before the 2000 files. So I wrote a procedure to rename all of the files with a 19 prefix. It included a UserForm interface to drill down through your folder structure to find a target folder, and the option to include all of its subfolders. You will need to make some adjustments in the criteria, but hopefully this will give you a headstart.
-
WSfatherjack
AskWoody Lounger
Viewing 3 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Add serial device in Windows 11
by
Theodore Dawson
5 hours, 16 minutes ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
6 hours, 16 minutes ago -
Cached credentials is not a new bug
by
Susan Bradley
9 hours, 50 minutes ago -
Win11 24H4 Slow!
by
Bob Bible
10 hours, 1 minute ago -
Microsoft hiking XBox prices starting today due to Trump’s tariffs
by
Alex5723
7 hours, 12 minutes ago -
Asus adds “movement sensor” to their Graphics cards
by
n0ads
12 hours, 11 minutes ago -
‘Minority Report’ coming to NYC
by
Alex5723
8 hours, 31 minutes ago -
Apple notifies new victims of spyware attacks across the world
by
Alex5723
20 hours, 53 minutes ago -
Tracking content block list GONE in Firefox 138
by
Bob99
20 hours, 17 minutes ago -
How do I migrate Password Managers
by
Rush2112
4 hours, 7 minutes ago -
Orb : how fast is my Internet connection
by
Alex5723
5 hours, 56 minutes ago -
Solid color background slows Windows 7 login
by
Alex5723
1 day, 8 hours ago -
Windows 11, version 24H2 might not download via Windows Server Updates Services
by
Alex5723
1 day, 7 hours ago -
Security fixes for Firefox
by
Susan Bradley
7 hours, 31 minutes ago -
Notice on termination of services of LG Mobile Phone Software Updates
by
Alex5723
1 day, 19 hours ago -
Update your Apple Devices Wormable Zero-Click Remote Code Execution in AirPlay..
by
Alex5723
2 days, 4 hours ago -
Amazon denies it had plans to be clear about consumer tariff costs
by
Alex5723
1 day, 19 hours ago -
Return of the brain dead FF sidebar
by
EricB
1 day, 6 hours ago -
Windows Settings Managed by your Organization
by
WSDavidO61
9 hours, 35 minutes ago -
Securing Laptop for Trustee Administrattor
by
PeachesP
6 hours ago -
The local account tax
by
Susan Bradley
1 day, 7 hours ago -
Recall is back with KB5055627(OS Build 26100.3915) Preview
by
Alex5723
2 days, 17 hours ago -
Digital TV Antenna Recommendation
by
Win7and10
2 days, 9 hours ago -
Server 2019 Domain Controllers broken by updates
by
MP Support
3 days, 5 hours ago -
Google won’t remove 3rd party cookies in Chrome as promised
by
Alex5723
3 days, 6 hours ago -
Microsoft Manager Says macOS Is Better Than Windows 11
by
Alex5723
3 days, 10 hours ago -
Outlook (NEW) Getting really Pushy
by
RetiredGeek
2 days, 12 hours ago -
Steps to take before updating to 24H2
by
Susan Bradley
10 hours, 27 minutes ago -
Which Web browser is the most secure for 2025?
by
B. Livingston
2 days, 16 hours ago -
Replacing Skype
by
Peter Deegan
2 days, 5 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.