Solved

Modifying local folder name...

Posted on 2004-09-28
6
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb example issues 3 88
MS Access VBA How To Properly Set Up A multipart/related HTTP Request 13 141
CSV file copy field 1 to field 2 2 62
Convert number to hex in Lua 16 91
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

739 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