Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8537253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:51:26+00:00 2026-06-11T10:51:26+00:00

Enviroment: Visual Studio 2010, Windows Forms Application. Hi! I would like to rename (batch)

  • 0

Enviroment: Visual Studio 2010, Windows Forms Application.

Hi! I would like to rename (batch) some files…
1.
I have (around 50 000 files): abc.mp3, def.mp3, ghi.mp3
I want: abc1.mp3, def1.mp3, ghi1.mp3

2.
I have (around 50 000 files): abc.mp3, def.mp3, ghi.mp3
I want: 1abc.mp3, 1def.mp3, 1ghi.mp3

Something similar…

    FolderBrowserDialog folderDlg = new FolderBrowserDialog();
    folderDlg.ShowDialog();

    string[] mp3Files = Directory.GetFiles(folderDlg.SelectedPath, "*.mp3");
    string[] newFileName = new string[mp3Files.Length];

    for (int i = 0; i < mp3Files.Length; i++)
    {
        string filePath = System.IO.Path.GetDirectoryName(mp3Files[i]);
        string fileExt = System.IO.Path.GetExtension(mp3Files[i]);

        newFileName = mp3Files[i];

        File.Move(mp3Files[i], filePath + "\\" + newFileName[1] + 1 + fileExt);
    }

But this code doesn’t work. Error here… newFileName = mp3Files[i];
And I cannot to convert it correctly.
Thank You!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:51:28+00:00Added an answer on June 11, 2026 at 10:51 am

    Fastest option would be use direct OS renaming function. Use process object to run shell CMD with /C switch. Use the “ren” command line renaming.

    Process cmd = new Process()
    {
        StartInfo = new ProcessStartInfo()
        {
            FileName = "cmd.exe",
            Arguments = @"/C  REN c:\full\path\*.mp3 c:\full\path\1*.mp3"
        }
    };
    
    cmd.Start();
    cmd.WaitForExit();
    
    //Second example below is for renaming with file.mp3 to file1.mp3 format
    cmd.StartInfo.Arguments = @"/C  REN c:\full\path\*.mp3 c:\full\path\*1.mp3";
    cmd.Start();
    cmd.WaitForExit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to do some C development in Windows environment using Visual Studio
I have created a web application using Visual Studio 2010 on a Windows Server
I have test this code on my development environment (windows 7, visual studio 2010)
Environment: Visual Studio Ultimate 2010 Windows XP WPF Desktop Application using .NET 4.0 We
I have a web application solution existing under Visual Studio 2010. Part of this
Environment: Visual Studio Ultimate 2010 .NET 4.0 Windows XP, Vista and 7 We have
Environment: Windows 7 SP1 Visual Studio 2010 Ultimate SP1 .NET 4.0 I have a
I've made a new proyect on Visual Studio 2010. It's a Windows Forms one,
I think I may have accidently disabled stylecop in my Visual Studio 2008 enviroment.
I have a c# Windows Forms application, using .NET 3.5. My machine environment is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.