How to separate paths from script


Instead of hard-coding your paths, you can put them in path.txt. Then using “for /f” to go thru each line in path.txt, parse each line and process it.

Why do we do this? it’s because of flexibility. Everyone can have a personalized set of directories he/she wants to compile since it takes too long to compile everything without messing with the script. You can update your script w/0 your path file and vice versa.

Example:

for /f "eol=; tokens=1,2 delims= " %%I in (path.txt) do (
call vs8build %commonPath%%%I%%J.sln %cfg% %commonPath%%logprefix%_%%J.txt %commonPath%%sumlogprefix%_%%J.txt %3)
Advertisements
How to separate paths from script

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s