Quantcast
Viewing all articles
Browse latest Browse all 1750

Nested setlocal gives problems with aliases resolving in DO /P

There is a problem when we used nested setlocal.

We have two batch files
DO_P.btm

Code:
setlocal
echo OsBuild=%_OSbuildEx
which cl_grep
cl_grep
call dummy.btm

set _key=HKCU\AppEvents\Schemes\Apps\.Default\AppGPFault

do c in /P `regdir /dfv %_key | CL_grep -i ".current[\]"`
  echo %c
enddo
endlocal

dummy.btm
Code:
setlocal & echo Dummy Text & endlocal
quit

Call DO_P gives:
Code:
OsBuild=22000.376
CL_grep is an alias : "CLPath:\grep.exe"
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep...

Read more

Viewing all articles
Browse latest Browse all 1750