Link to home
Start Free TrialLog in
Avatar of wgyger12
wgyger12

asked on

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?
Avatar of tusharashah
tusharashah

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
ASKER CERTIFIED SOLUTION
Avatar of avi247
avi247

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of wgyger12

ASKER

Thanks AVI. I prefer to stay away from FSO if at all possible, and the API call seems to do the trick.