web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Rename Mp3 Files in a ...
Power Automate
Unanswered

Rename Mp3 Files in a Folder using the Title in the metadata properties

(0) ShareShare
ReportReport
Posted on by 4

Hay Folks!,
I am new to Flows 🙂
I am trying to build a flow in Power Automate Desktop to rename a bunch of Mp3 files based on the Title property in the corresponding detail section of each file. Hope the following screenshot explains it all.
Thanks

Fowmy_0-1650898879761.png

 

I have the same question (0)
  • VJR Profile Picture
    7,635 on at

    If I have a folder with file names and their titles in the below format (as an example)

     

    VJR_1-1650946158009.png

     

     

    They get renamed to Title after running the Flow

     

    VJR_3-1650946606313.png

     

     

     

    This is a vbscript approach. You can use anything else like Powershell etc.

    The script used is:

     

     Dim oAppShell, oFolder, output
     
     Set objFso = CreateObject("Scripting.FileSystemObject")
     Set oAppShell = CreateObject("Shell.Application")
     
     varFolderPath = "%FolderPath%"
     Set oFolder = oAppShell.Namespace(varFolderPath)
     
     
     For Each oItem In oFolder.Items
     'Check here if title is empty
     
     'If a file with already same name exists while moving then it will throw error. Please handle accordingly
     objFso.MoveFile oItem.Path, varFolderPath & oFolder.GetDetailsOf(oItem, 21) & ".mp3" '21 is to get the Title
     Next
     
     

     

    Copy paste the below code in a blank flow editor and check the outputs.

    Please refer the green comments inside the vbscript.

     

    SET FolderPath TO $'''C:\\Test\\'''
    Scripting.RunVBScript VBScriptCode: $''' Dim oAppShell, oFolder, output
     
     Set objFso = CreateObject(\"Scripting.FileSystemObject\")
     Set oAppShell = CreateObject(\"Shell.Application\")
     
     varFolderPath = \"%FolderPath%\"
     Set oFolder = oAppShell.Namespace(varFolderPath)
     
     
     For Each oItem In oFolder.Items
     \'Check here if title is empty
     
     \'If a file with already same name exists while moving then it will throw error. Please handle accordingly
     objFso.MoveFile oItem.Path, varFolderPath & oFolder.GetDetailsOf(oItem, 21) & \".mp3\" \'21 is to get the Title
     Next
     
     ''' ScriptOutput=> VBScriptOutput ScriptError=> ScriptError
    Display.ShowMessageDialog.ShowMessage Message: $'''DONE''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed
    
    # [ControlRepository][PowerAutomateDesktop]
    
    {
     "ControlRepositorySymbols": [],
     "ImageRepositorySymbol": {
     "Name": "imgrepo",
     "ImportMetadata": {},
     "Repository": "{\r\n \"Folders\": [],\r\n \"Images\": [],\r\n \"Version\": 1\r\n}"
     }
    }
    

     

     

     

  • Verified answer
    JamesP_MSFT Profile Picture
    Microsoft Employee on at

    @Fowmy if the answer solved your issue, please mark the thread as resolved.
    Thank you.

  • Fowmy Profile Picture
    4 on at

    Thanks for the support @VJR 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard