C:\F9-AA1.TXT has the content below
DIR /B /O *.* &REM EEEE
DIR /B /O /A-D *.* &REM no dirs when files
DIR /B !!*.*
DIR /B *.B*
DIR /B *.EXE
DIR
------------------------------------------
@ECHO OFF
SET K1=C:\F9-AA1.TXT
FOR /F "Delims=" %%V IN ('TYPE %K1%') DO (
CALL :Z-Delayed2 "%%V"
)
GOTO :EOF
:Z-Delayed2
SET "Sname=%~1"
SET "U=%Sname%"
SET H="%U%"
ECHO %H:~1,-1%
@EXIT /B
how can i display the list content without the quotation marks when there might be ampersands present? &REM remarks must be shown since they can explain the options to me.
*restrictions
1. hope to use CALL, because the strings from %%V will be heavily edited later (with FOR, IF, SET), this call structure is one i am going for at the moment
2. must NOT use SetLocal EnableExtensions EnableDelayedExpansion - i am done +20 years over flondering with EnableDelayed and "!" conflicts, i am removing all essential EnableDelayedExpansion from my batches but then i start to have a new problem with &. but i'd figure if & were not a real part of the batch operators for my use, then i might have a chance.
is there a way to display the list without the quotation marks when ampersands present?
Moderator: DosItHelp
-
- Posts: 232
- Joined: 01 Oct 2012 13:32
- Location: Ireland
- Contact:
Re: is there a way to display the list without the quotation marks when ampersands present?
Hi nnnmmm,
Here’s an old trick I learnt from Jeb:
Read this SO Q&A for the full story.
Ho ho ho!
- SB
Here’s an old trick I learnt from Jeb:
Code: Select all
for %%^" in ("") do echo(%%~"poison characters ! ^ & < | > without quotes%%~"
Ho ho ho!
- SB