How to dynamically escape % symbols?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
SIMMS7400
Posts: 541
Joined: 07 Jan 2016 07:47

How to dynamically escape % symbols?

#1 Post by SIMMS7400 » 04 Apr 2024 15:53

Hi All -

We have automation passwords that need to be encrypted for our financial applications. We have a password generator/randomizer that we use. When % symbols are present, we need to remember to always escape them, however, a lot of the folks forget to do that.

Let's say I have a string : O*!)v5ib0&73d(KGQ&A%

Is there a way to write code to automatically escape that making it : O*!)v5ib0&73d(KGQ&A%%

?

Haven't found a way yet.

Squashman
Expert
Posts: 4470
Joined: 23 Dec 2011 13:59

Re: How to dynamically escape % symbols?

#2 Post by Squashman » 06 Apr 2024 19:18

Jeb's MagicEcho might help
viewtopic.php?t=6446

jeb
Expert
Posts: 1042
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: How to dynamically escape % symbols?

#3 Post by jeb » 08 Apr 2024 01:33

SIMMS7400 wrote:
04 Apr 2024 15:53
We have automation passwords that need to be encrypted for our financial applications. We have a password generator/randomizer that we use. When % symbols are present, we need to remember to always escape them, however, a lot of the folks forget to do that.
Without further description of the involved batch files this can't be answered.

Where is the password stored, in the batch file itself, in a config file, is it read by set /p ???

SIMMS7400
Posts: 541
Joined: 07 Jan 2016 07:47

Re: How to dynamically escape % symbols?

#4 Post by SIMMS7400 » 08 Apr 2024 16:35

jeb wrote:
08 Apr 2024 01:33
SIMMS7400 wrote:
04 Apr 2024 15:53
We have automation passwords that need to be encrypted for our financial applications. We have a password generator/randomizer that we use. When % symbols are present, we need to remember to always escape them, however, a lot of the folks forget to do that.
Without further description of the involved batch files this can't be answered.

Where is the password stored, in the batch file itself, in a config file, is it read by set /p ???
Hi Jeb - it's a user prompt. The user enters it and it's stored via set /p.

Thank you!

Sponge Belly
Posts: 221
Joined: 01 Oct 2012 13:32
Location: Ireland
Contact:

Re: How to dynamically escape % symbols?

#5 Post by Sponge Belly » 10 Apr 2024 08:16

Hi SIMMS7400,

You may want to read the Mask Password with Asterisk topic. ;)

- SB

Post Reply