I use the methods of the File class to perform utility functions on existing files. I notice, however, that there is no Rename method. How does one do a simple file rename in VB?
Thank you
John Littell
![]() |
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 |
Home » Forums » Developers, developers, developers » DevOps Lounge » Rename a File (VB 2008 Express Edition)
Please post your questions in the appropriate forum. This is a .Net question, not classic VB, just like post 721,406 some weeks ago.
I’ll move the thread
I refer you to the msdn article and the snippet
My.Computer.FileSystem.RenameFile(“C:Test.txt”, “SecondTest.txt”)
The Lounge hasn’t been down, but it’s very slow every day between 23:00 and 01:00 UTC because the daily backup is made durong that time – see for example the thread starting at post 719,531.
Sorry, I don’t monitor the .Net forum closely, so I missed your PS.
Danny is correct. VB5 / VB6 and (Office) VBA all use “classic” Visual Basic. Questions about those can be posted in the VB / VBA forum.
VB.NET, VB2003, VB2005 and VB2008 all use a newer version of Visual Basic that is quite different from “classic” VB, so there’s a separate forum for everything related to these versions.
See Visual Basic .NET on Wikipedia for an overview.
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.
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.
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.
Notifications