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. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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
Loop -
WSjscher2000
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
-
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
2 hours, 5 minutes ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
2 hours, 13 minutes ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
1 hour ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
12 hours, 3 minutes ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
2 hours, 28 minutes ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
14 hours, 43 minutes ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
6 hours, 59 minutes ago -
Some advice for managing my wireless internet gateway
by
LHiggins
2 hours, 40 minutes ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
8 hours, 55 minutes ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
1 day ago -
Sometimes I wonder about these bots
by
Susan Bradley
20 hours, 30 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
10 hours, 32 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
1 day, 14 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
1 day, 13 hours ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
1 hour, 47 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
1 day, 16 hours ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
1 day, 16 hours ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
1 day, 5 hours ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
2 days, 1 hour ago -
0Patch, where to begin
by
cassel23
1 day, 19 hours ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
2 days, 14 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
2 days, 2 hours ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
2 days, 23 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
2 days, 14 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
2 days, 1 hour ago -
Installer program can’t read my registry
by
Peobody
18 hours, 5 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
2 days, 11 hours ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
2 days, 19 hours ago -
False error message from eMClient
by
WSSebastian42
3 days, 10 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
3 days, 19 hours ago
Recent blog posts
Key Links
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.