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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Renaming directory whe...
Power Automate
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:
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,847 Moderator on at
    Have you placed this question in the correct forum?
  • SirenGlitch Profile Picture
    4 on at
    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,847 Moderator on at
    Is this Power automate desktop?
  • SirenGlitch Profile Picture
    4 on at

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 173 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 95 Super User 2026 Season 1

Last 30 days Overall leaderboard