Space in a variable
Posted: 06 Apr 2018 08:02
@echo on &setlocal
setlocal enableDelayedExpansion
If "%computername%" == "DTC" (
SET NS=\\xx
SET OPSDIR=!NS!\ProAdmin
SET COGDIR=!NS!\CREM
)
set "list=%COGDIR%\Config\Copy_Daily_EMTS_Reporting.txt"
echo %list%
pause
Why the list shows a space after cogdir in list? How to remove that space?
it shows \\xx\CREM \Config\Copy_Daily_EMTS_Reporting.txt
setlocal enableDelayedExpansion
If "%computername%" == "DTC" (
SET NS=\\xx
SET OPSDIR=!NS!\ProAdmin
SET COGDIR=!NS!\CREM
)
set "list=%COGDIR%\Config\Copy_Daily_EMTS_Reporting.txt"
echo %list%
pause
Why the list shows a space after cogdir in list? How to remove that space?
it shows \\xx\CREM \Config\Copy_Daily_EMTS_Reporting.txt