How to remove Quotes from a variable with "ampersand" (&) ?
ex
setlocal disabledelayedexpansion
set dir="D:\Test ! & Test\"
set dir=%dir:"=%
after
echo %dir%
D:\Test ! Test\
Sign & is missing !!!!
Please help
How to remove Quotes from a variable with "ampersand" (&) ?
Moderator: DosItHelp
-
- Posts: 31
- Joined: 08 Sep 2017 06:10
-
- Posts: 128
- Joined: 23 May 2016 15:39
- Location: Spain
Re: How to remove Quotes from a variable with "ampersand" (&) ?
you can use a for loop to remove quotes with the ~ modifier. see for /? for further information.
Code: Select all
for %%a in (%dir%) do echo %%~a