Page 1 of 1

es run errors

Posted: Tue Dec 28, 2021 9:10 am
by wu_yi
I Input es c:\^|d:\ show correct but Input
for /f %A in ('es c:\^|d:\') do echo %A show errors

Re: es run errors

Posted: Tue Dec 28, 2021 9:23 am
by horst.epp
Thats no ES run error.
Its a simple CMD error message about the syntax of your command line.

Re: es run errors

Posted: Tue Dec 28, 2021 9:38 am
by void
Use double quotes:

Code: Select all

for /f %A in ('"es c:\^|d:\"') do echo %A
https://ss64.com/nt/for_cmd.html

Re: es run errors

Posted: Tue Dec 28, 2021 5:23 pm
by NotNull
Without using double quotes, you need an extra escape-level, due to the for-command:

Code: Select all

for /f %A in ('es c:\^^^|d:\') do echo %A

Re: es run errors

Posted: Thu Dec 30, 2021 1:05 am
by wu_yi
how can use content | in the for
es c:\^|d:\ regex:content:”\bAB\b|\bBA\b” show ok,but input
for /f %A in ('"es c:\^|d:\ regex:content:”\bAB\b|\bBA\b”"') do echo %A
show error

Re: es run errors

Posted: Thu Dec 30, 2021 2:26 am
by void
Please try:

Code: Select all

for /f %A in ('"es c:\^|d:\ regex:content:"\bAB\b^|\bBA\b""') do echo %A
Note ^| to escape |

The leading and trailing double quotes in
('"
and
'")
are removed when the command line is executed.

or, double escape special characters:

Code: Select all

for /f %A in ('es c:\^^^|d:\ regex:content:"\bAB\b^^^|\bBA\b"') do echo %A