@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
Space in a variable
Moderator: DosItHelp
-
- Posts: 51
- Joined: 10 Jan 2018 15:21
Space in a variable
- Attachments
-
- space
- Capture.PNG (22.73 KiB) Viewed 5213 times
Re: Space in a variable
1. use code tags to wrap your code [code]<your code>[/code]
2. i belive there is a space after "SET COGDIR=!NS!\CREM" (select it and you'll see)
2. i belive there is a space after "SET COGDIR=!NS!\CREM" (select it and you'll see)
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
-
- Posts: 51
- Joined: 10 Jan 2018 15:21
Re: Space in a variable
yeah, I see it now. quoted it and it is now resolved.
Thank you.
Thank you.