Help with renaming in xml file using


How do you rename an xml file in the applications's folder using

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
System.IO.File.Copy("OriginalName", "NewName")
Wayne Taylor (webtubbs)Commented:
You can also use File.Move.
Fernando SotoRetiredCommented:
Use the My.Computer.FileSystem.RenameFile Method. See documentation for an example at the bottom of the page.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Jacques Bourgeois (James Burger)PresidentCommented:
Personally, I never recommend My.Computer. This is only a shortcut provided for amateur VB programmers, to facilitate the move from VB classic to VB.NET.

Although it is an easy way out for the most common commands, it is a lot more limited than directly using the framework classes. For instance, the framework offers 5 classes to deal with files, directories and drives. My.Computer.FileSystem combines features from these 5 classes, but has less methods than each of the System.IO classes individually. The System.IO classes are thus a lot more powerful.

Also, My does not exist in other languages, it is a VB only feature. Taking the habit of using the "real" .NET classes instead of the wrapper that My will make it easier to eventually move to another language, because System.IO is available in every .NET language, while My exists only in VB.
vcharlesAuthor Commented:
Thank you forr all the comments.
Fernando SotoRetiredCommented:
Please close the question.

vcharlesAuthor Commented:
Thank You.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.