Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Unanswered

Renaming directory when path contains spaces

(1) ShareShare
ReportReport
Posted on by 4
I hope I'm just being stupid here.
 
I'm using a DOS command to get data about a file within a given directory, then using Crop Text to extract a specific part of this data. What I'm trying to do now is take that cropped data and add it to the end of the directory name, encased in square brackets ( [ ] ), giving a result of "<original Directory Name> [<extractedData>]". The problem is that the Rename Folder operation keeps failing, saying one of two errors depending on the code.
 
If the code looks like the below (double and single quotes give the same outcome), the error says that the Directory doesn't exist, which looking at the file system, is wrong.
 
However, if the code looks like the below, the error says that it "Can't rename folder" due to there being "Illegal characters in path", which I presume are the spaces in the path to Game.Directory, based off of the fact that the error changes when putting the "Folder to rename" in quotes as shown above.
 
Any ideas as to how to fix this? Preferably not removing the spaces in Game.Directory, but if it's the only solution then beit the solution
Categories:
  • SirenGlitch Profile Picture
    4 on at
    Renaming directory when path contains spaces
  • ronaldwalcott Profile Picture
    3,497 on at
    Renaming directory when path contains spaces
    Is this Power automate desktop?
  • SirenGlitch Profile Picture
    4 on at
    Renaming directory when path contains spaces
    Honestly I'm not sure, it's a problem with Power Automate, and I saw other people asking questions in the General Discussion forum so I followed, no idea if it was the right forum for the job
  • ronaldwalcott Profile Picture
    3,497 on at
    Renaming directory when path contains spaces
    Have you placed this question in the correct forum?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,631 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,976 Most Valuable Professional

Leaderboard