To insert ! (exclamation) into variable with delayed exp. mode

O

Ondrej Sevecek

Hello,
I would like to insert this text under delayed variable expansion mode ON:

SET variablewithexclamation=hello!howareyou


Ondra.
 
J

Jerold Schulman

Hello,
I would like to insert this text under delayed variable expansion mode ON:

SET variablewithexclamation=hello!howareyou


Ondra.
The following demonstrates how (call test xxx)

@echo on
SETLOCAL DISABLEDELAYEDEXPANSION
SET variablewithexclamation=hello^!howareyou
@echo %variablewithexclamation%
SETLOCAL ENABLEDELAYEDEXPANSION
@echo %variablewithexclamation%
endlocal
endlocal&set %1=%variablewithexclamation%
call echo.%%%1%%

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top