Solved

Modifying local folder name...

Posted on 2004-09-28
6
211 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
Comment Utility
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
Comment Utility
0
 
LVL 1

Expert Comment

by:Sibish
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
thread-safe code in c++ 2 69
java continue statement 10 70
word0 challenge 3 55
Eclipse Neon start with Admin account only 6 44
Purpose To explain how to place a textual stamp on a PDF document.  This is commonly referred to as an annotation, or possibly a watermark, but a watermark is generally different in that it is somewhat translucent.  Watermark’s may be text or graph…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now