Cmd.exe bug with special characters
Posted: 07 Feb 2021 12:50
I have a batch file called with the following:
If I escape the characters like this:
Then every command works.
But if I escape them like this:
Then only the first command works. The batch file exits after that. Why does this bug happen?
Code: Select all
`#'`#!^% ^%os%'&!&(.bat
Code: Select all
@echo off
echo Test
echo %0
echo Test 2
Code: Select all
set p=%
"`#'`#!^%p% ^%p%os%p%'&!&(.bat"
But if I escape them like this:
Code: Select all
`#'`#!^^^%" "^^^%os^%'^&!^&^(.bat