cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
hassan14a
Regular Visitor

CMD session: Command with %%

Hey,

 

I am having trouble with an command, that I use in another RPA tool with CMD.

The command has two percentage signs %%, and when I use this in Power Automate, it thinks that is has to look for a variable.

 

I have tried to use string(' ') without any luck.

Not sure how to fix this. Any help would be greatly appreciated :).

 

hassan14a_0-1645167860554.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Henrik_M
Dual Super User
Dual Super User

Write %%username%% in your command.

View solution in original post

3 REPLIES 3
Henrik_M
Dual Super User
Dual Super User

Write %%username%% in your command.

MichaelAnnis
Super User
Super User

@Henrik_M Nailed it. A single percentage sign is used as a variable identifier. The first one starts it and the second one ends it. That’s the easy one, but there are other characters that have to be escaped depending on the action you are using. If you ever feel like PAD is changing your text, then there is an ESCAPE TEXT action that will take care of this, so, if I have %Textvariable% that I know has a % sign in it, and I want to escape it:

 

Escape text %TextVariable% to %EscapedText% then I can use %EscapedText% where I was using the %TextVariable% and it will be altered so PAD doesn’t mess it up. 

hassan14a
Regular Visitor

Hi guys,

 

Thanks for the tips.

EDIT: My bad. %% did work. I accidentally had an ekstra ' inserted.

 

But Regarding the Escape test, then unfortunately it does not seem to work with %username%, it still thinks that username is a variable.

 

hassan14a_2-1645175321134.png

 

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (1,219)