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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Dos Command doesn't wo...
Power Automate
Answered

Dos Command doesn't work in Power Automate desktop - Dos Command with "%" error

(1) ShareShare
ReportReport
Posted on by 42

- I need to copy Images into a folder

- I use a list because my Images are in multiple locations

+ I have a list with all filepaths/filenames called imagelist.txt and an output folder

 

This dos command works in command Prompt, but I get a syntax error in power automate desktop:

So this works in command line :

FOR /F "USEBACKQ TOKENS=*" %F IN ("C:\.....Input\imagelist.txt") DO XCOPY /F /Y "%~F" "C:\...\Output\"

 

But I get a syntaxerror with the same command in PowerAutomate desktop.

I think I get the error because of the red parts.

PowerAutomate thinks I want to declare a Varaible or something.

FOR /F "USEBACKQ TOKENS=*" %F IN ("C:\.....Input\imagelist.txt") DO XCOPY /F /Y "%~F" "C:\...\Output\"

 

Is there a work around?

 

THANK YOU M8s

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

    Hi @10101 

     

    Try using 2 percent signs next to each other and check what happens.

     

    Another option put your command inside a variable and then pass that variable to the "Run Dos command" action of PAD.

  • 10101 Profile Picture
    42 on at

    You are a genius!!

    Two %% and everything works 🙂

    Thanks m8

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 248 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 160 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 142 Super User 2026 Season 2

Last 30 days Overall leaderboard