Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The input line is too long" error in a very basic script for no obvious reason

The following script

cmd /C ""set PATH=nasm\;%PATH%" & "echo %PATH%""

Only prints this:

The input line is too long.
The input line is too long.

Why? How can I fix this?

P. S. This works:

cmd /C "echo %PATH%"

And this doesn't:

cmd /C ""echo %PATH%""
like image 427
Violet Giraffe Avatar asked Aug 20 '15 11:08

Violet Giraffe


1 Answers

The OP's problem differed slightly from mine, but I also had The input line is too long error in a very basic script for no obvious reason.

In my case, the reason that it was not obvious is that I had earlier corrupted my environment by recursively setting my Path until it exceeded the permissible size and then I had fixed the issue before attempting to diagnose the error.

Restarting the command prompt was sufficient in this case to get a fresh Path.

To test if you might have done something like this, just display your environment variables by running set with no arguments. In my case, it showed the recursively set Path (much longer than shown here, but you see the repeating parts):

C:\dev_build>set
...
Path=C:\qnx660\host\win32\x86\usr\bin;C:\qnx660\.qnx\bin;C:\qnx660\jre\bin;C:\qnx660\host\win32\x86\usr\bin;C:\qnx660\.qnx\bin;C:\qnx660\jre\bin;C:\qnx660\host\win32\x86\usr\bin;C:\qnx660\.qnx\bin;C:\qnx660\jre\bin;C:\qnx660\host\win32\x86\usr\bin;C:\qnx660\.qnx\bin;C:\qnx660\jre\bin;C:\qnx660\host\win32\x86\usr\bin;C:\qnx660\.qnx\bin;C:\qnx660\jre\bin;C:\qnx660\host\win32\x86\usr\bin;C:\qnx660\.qnx\bin;C:\qnx660\jre\bin;C:\qnx660\host\win32\x86\usr\bin;C:\qnx660\.qnx\bin;...
...

Any further attempts to do anything to Path gave me The input line is too long

like image 188
sage Avatar answered Oct 12 '22 13:10

sage