0

This is what I have:

> set email=echo abc@xyz.com
> echo %email%

the above snippet echoes echo abc@xyz.com. I want it to print abc@xyz.com instead.

I tried echo abc@xyz.com | set email as well. same result.

How do I do that?

Dylan Czenski
  • 1,305
  • 4
  • 29
  • 49
  • Does this answer your question? [Batch equivalent of Bash backticks](https://stackoverflow.com/questions/2768608/batch-equivalent-of-bash-backticks) – CherryDT Jul 09 '20 at 23:34
  • 2
    Any reason to not just `set "email=abc@xyz.com"`? – Stephan Jul 10 '20 at 07:54

1 Answers1

0

You could let cmd eval it:

@ECHO OFF
set email=echo abc@xyz.com
%email%

I use this on our Windows 10, 2016 and 2019 regulary. I don't know if it works for older versions though.