I want to run a script which only purpose is to execute its first argument, so I have the following script:
set command=%~1
%command%
And I run it like RunCommand.bat "echo hello world"
which works.
Now I want to escape any special char, for example double quote. I tried a couple of options but non works. Any ideas?
This is my closest: RunCommand.bat "echo ""special char"""
which prints-> ""special char""
EDIT
This script works
set "command=%~1"
set "command=%command:""="%"
%command%
refferenced from Escaping Double Quotes in Batch Script