How do I rename a file using WSH?

John Savill

March 17, 2000

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. Using the MoveFile method on a FileSystem object will result in afile being renamed:

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
fso.MoveFile "file1.txt", "file2.txt"

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like