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?
wgyger12Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
tusharashahCommented:
To rename folder you use MoveFolder procedure:

------------------------------------------------------------------------------------
Dim fso

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

------------------------------------------------------------------------------------

-tushar
0
 
SibishCommented:
Hi,

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
0
 
wgyger12Author Commented:
Thanks AVI. I prefer to stay away from FSO if at all possible, and the API call seems to do the trick.
0
All Courses

From novice to tech pro — start learning today.