views:

52

answers:

2

When I have setlocal ENABLEDELAYEDEXPANSION set in a cmd script is there any way I can escape a ! that I want to use as a parameter to a command?

@echo off
setlocal ENABLEDELAYEDEXPANSION
echo I want to go out with a bang!
echo I still want to go out with a bang^!
A: 

The normal escape character is ^. Try it with that.

data
No quite, thanks anyway
Andy Morris
+1  A: 

That's what I found (^^)

@echo off
setlocal ENABLEDELAYEDEXPANSION
echo I want to go out with a bang^^!
K. Claszen
Stunning, thanks
Andy Morris