Question:
In VB, how do you rename a file (at runtime)?
Answer:
Use the FileSystem object (Microsoft Scripting Runtime, SCRRUN.dll) as follows:
Dim fs As New FileSystemObjectDim f As FileSet f = fs.GetFile(Filename)f.Name = NewFileName
Home » Rename a file
Question:
In VB, how do you rename a file (at runtime)?
Answer:
Use the FileSystem object (Microsoft Scripting Runtime, SCRRUN.dll) as follows:
Dim fs As New FileSystemObjectDim f As FileSet f = fs.GetFile(Filename)f.Name = NewFileName
At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.
See our full editorial policy.