0

I'm performing a mass build (1000+) projects. I call a batch file that calls another batch file that contains a long list of calls to project builds. The problems is, after a few projects, the process stops and says "The input line is too long". I did some research and found that the path environment vars are probably changing and therefore becoming too long. How can I reset the path variable between each of the build calls? Or is there another way I can solve this problem?

1
  • I will try that. May take a while to test. Commented Jun 25, 2014 at 21:16

1 Answer 1

2

A simple solution is that in the batch file which modifies PATH or in one of the parent batch files you insert the line

set InitialPath=%PATH%

And later when the project is built another a line is inserted

PATH=%InitialPath%

A small batch file demonstrating this simple solution:

@echo off
rem Remember initial value of environment variable PATH.
set InitialPath=%PATH%
rem Environment variable PATH is modified to include a compiler directory.
PATH=C:\Program Files (x86)\MyCompiler\bin;%PATH%
rem Do here whatever must be done with modified PATH.
echo %PATH%
rem Restore the initial value of environment variable PATH.
PATH=%InitialPath%
echo %PATH%
rem Optionally the environment variable InitialPath is removed finally.
set InitialPath=
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.