Modifying local folder name...

Does anyone know how to go about changing the name of a folder using FSO? If not possible, is there an API available to do this?
Who is Participating?
To rename folder you use MoveFolder procedure:

Dim fso

Set fso = Server.CreateObject("Scripting.FileSystemObject")
fso.MoveFolder "C:\test1", "C:\test2"
Set fso = Nothing



The easiest way to do this is to use the Name function. For example, you need to change the sam folder to sun, which is residing in the c:\ drive.

  Name "c:\sam" as "c:\sun"

This is so simple.
Try it out
wgyger12Author Commented:
Thanks AVI. I prefer to stay away from FSO if at all possible, and the API call seems to do the trick.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.