es run errors

General discussion related to "Everything".
Post Reply
wu_yi
Posts: 10
Joined: Sun Dec 26, 2021 2:16 am

es run errors

Post by wu_yi »

I Input es c:\^|d:\ show correct but Input
for /f %A in ('es c:\^|d:\') do echo %A show errors
horst.epp
Posts: 1445
Joined: Fri Apr 04, 2014 3:24 pm

Re: es run errors

Post by horst.epp »

Thats no ES run error.
Its a simple CMD error message about the syntax of your command line.
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: es run errors

Post 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
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: es run errors

Post 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
wu_yi
Posts: 10
Joined: Sun Dec 26, 2021 2:16 am

Re: es run errors

Post 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
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: es run errors

Post 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
Post Reply