tags:

views:

544

answers:

2

Hi,

I need to do a .bat for DOS that do the following:

set ROOT = c:\programas\
set SRC_ROOT = (I want to put the ROOT Here)System\Source

so after defining ROOT I want to have SCR_ROOT = c:\programas\System\Source

How can I do that? thanks

+7  A: 

Hi try this :

set ROOT = c:\programs 
set SRC_ROOT = %ROOT%\System\Source

By the way, what is the meaning of the | after the ROOT ? A mispelling ?

Gregoire

EDIT : without spaces

set ROOT=c:\programs 
set SRC_ROOT=%ROOT%\System\Source
podosta
yes... it's a mispelling...What you wrote was the first thing i've tried... It doesn't work...if I do a echo to SRC_ROOT only \system|source appears
UcanDoIt
in fact the spaces between the = are not necessery, try : set ROOT=c:\programs set SRC_ROOT=%ROOT%\System\Source
podosta
it doenst work :S
UcanDoIt
could you post your whole script in order to understand the issue, on my command prompt those two commands are working and ECHO %SRC_ROOT% give me the right answer..
podosta
it's is worling now. thanks a lot :)btw imagine i want now to open a txt file and put:set ROOT = string I catch from the file?How can I do that?
UcanDoIt
I'm sorry, I don't understand what you mean with opening a txt file and put "set ROOT=string".
podosta
A: 

Hi

Note that if spaces are needed then quotation marks are needed at definition and must be chopped while concatenating:

rem The retail files set
set FILES_SET="(*.exe *.dll"

rem The debug extras files set
set DEBUG_EXTRA=" *.pdb"

rem Build the DEBUG set without any
set FILES_SET=%FILES_SET:~1,-1%%DEBUG_EXTRA:~1,-1%

rem Append the cloasing bracket
set FILES_SET=%FILES_SET%)

echo %FILES_SET%

Cheers...

Hertzel Guinness