Ahh, wait, disregard that last not sure why you need the quotes statement, I understand
Regards...
Main Topics
Browse All TopicsIf I have environmental variables like:
X3DESTDIR="C:\Destination Folder"
X4DESTFIL="\zzzfiles\Subfo
how can the two strings be concatenated. The use of percent signs like
SET FINAL_DEST=%DESTDIR%%DESTF
results in extranneous quotes, i.e.
FINAL_DEST="C:\Destination
How to eliminate the extra quotes ("") in the middle of the result?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hello Zyloch,
Thanks for the feedback, I don't want to strip out the quotes, I need the quotes to handle spaces in the folder and directory names.
Essentially, I'm looking for syntax that will take the strings "John Q." and " Public" and produce "John Q. Public", rather than "John Q."" Public"
Further thoughts?
Give this a try:
@echo off
setlocal enabledelayedexpansion
set X3DESTDIR="C:\Destination Folder"
set X4DESTFIL="\zzzfiles\Subfo
call :CONCAT FINAL_DEST %X3DESTDIR% %X4DESTFIL%
echo FINAL_DEST=%FINAL_DEST%
goto :EOF
:CONCAT
if "%~1"=="" goto :EOF
set EnvName=%~1
set %EnvName%=
:GETPARM
shift
if "%~1"=="" goto :EOF
set %EnvName%=!%EnvName%!%~1
goto GETPARM
Good Luck,
Steve
Business Accounts
Answer for Membership
by: ZylochPosted on 2004-09-17 at 07:16:15ID: 12084667
Hi dpichett,
IL:~1%
You could always do
SET FINAL_DEST=%DESTDIR%%DESTF
even though I'm not sure why you need the quotes...
Regards,
Zyloch