Page 1 of 1

ENABLEDELAYEDEXPANSION exclamation mark

Posted: 30 Aug 2019 00:49
by nikhiltom
Hello,

Could someone please help me how to include exclamation marks if ENABLEDELAYEDEXPANSION is enabled,

For example,

setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
for %%x in (%*) do echo %%x
pause

The above code will display the item names copied to context menu without any issues unless there's an exclamation mark in file name,

May I please know how can I print filenames including exclamation marks (!) as well (eg: name!file.txt)

Thanks

Re: ENABLEDELAYEDEXPANSION exclamation mark

Posted: 30 Aug 2019 05:25
by Szecska
A similar question is being discussed:viewtopic.php?f=3&t=9250

Re: ENABLEDELAYEDEXPANSION exclamation mark

Posted: 01 Sep 2019 07:47
by nikhiltom
Hello,

But that's about replacing the bang (!) character,

How can I include it in the echo print?

Thanks

Re: ENABLEDELAYEDEXPANSION exclamation mark

Posted: 01 Sep 2019 07:54
by aGerman
In your example you don't need ENABLEDELAYEDEXPANSION. Try with DISABLEDELAYEDEXPANSION.
Provide an example that is closer to your real code and where we can see why you actually have trouble...

Steffen