cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
10101
Frequent Visitor

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

- 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

1 ACCEPTED SOLUTION

Accepted Solutions
VJR
Super User
Super User

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.

View solution in original post

2 REPLIES 2
VJR
Super User
Super User

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
Frequent Visitor

You are a genius!!

Two %% and everything works 🙂

Thanks m8

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Top Solution Authors
Top Kudoed Authors
Users online (5,022)