Solved

Modifying local folder name...

Posted on 2004-09-28
6
230 Views
Last Modified: 2013-11-13
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?
0
Comment
Question by:wgyger12
6 Comments
 
LVL 18

Expert Comment

by:tusharashah
ID: 12172680
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
 
LVL 4

Accepted Solution

by:
avi247 earned 500 total points
ID: 12173313
0
 
LVL 1

Expert Comment

by:Sibish
ID: 12178883
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
 

Author Comment

by:wgyger12
ID: 12182076
Thanks AVI. I prefer to stay away from FSO if at all possible, and the API call seems to do the trick.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question