"输入线过长"错误bat文件 [英] "Input line is too long" error in BAT File

查看:668
本文介绍了"输入线过长"错误bat文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有执行一个bat文件有问题。运行一段时间后,我得到了输入行太长错误。

I am having a problem executing a bat file. After some time running I get the "input line is too long" error.

bat文件的结构很简单。有调用该负责更新我的系统模块数据10蝙蝠等文件的主要bat文件。在更新数据批处理文件也有很多的电话我的系统的命令(.cmd文件),负责通过一些计算更新数据。

The structure of the bat file is simple. There is a main bat file that calls 10 other bat files that are responsible for updating data of my system modules. In the updating data bat files there are lot of calls for a command(.cmd file) of my system that is responsible for updating the data through some calculations.

问题的关键是,当进程是在一台Windows 2003 Server中运行也没关系。没有错误。

The point is, when the process was running in a Windows 2003 Server it was ok. No errors.

然后,当它被升级到Windows 2008服务器,我执行主bat文件,几个小时后,我收到了输入行太长错误。我甚至无法执行包含在手动更新后的数据蝙蝠在cmd窗口的任何命令。但是,如果我关闭cmd窗口,并打开一个新的我可以执行的命令没有错误。

Then, when it was upgraded to Windows 2008 Server, I execute the main bat file, several hours later I got the "Input line is too long" error. I can't even execute any command included in the updated data bats manually in that cmd window. But if I close the cmd window and open a new one I can execute the commands without errors.

任何人有同样的问题?或解决方案?

Anybody had the same problem? Or a solution?

先谢谢了。

推荐答案

在一个cmd窗口执行构建脚本时,我有过同样的问题。经过约13倍我得到了同样的错误。构建脚本必须确保vcvarsall.bat已运行,因此vcvarsall.bat每次执行。

I have had this same problem when executing a build script in a cmd window. After about 13 times I got that same error. The build script had to make sure that vcvarsall.bat was run so it executed vcvarsall.bat every time.

vcvarsall.bat是不是足够聪明,唯一的东西添加到路径如果他们不是已经有这么加了一堆重复的条目。

vcvarsall.bat is not smart enough to only add things to the path if they are not already there so a bunch of duplicate entries were added.

我的解决办法是在一个环境变量,我知道是vcvarsall.bat ...

My solution was to add an if defined check on an environment variable which I know is set by vcvarsall.bat...

if not defined DevEnvDir (
    call vcvarsall.bat
)

检查PATH环境变量每次运行之后,看看它是否在增长。如果是,有重复的,你需要聪明地添加东西到路径。有几种方法要聪明一点。

Check your path environment variable after each run and see if it is growing. If it is and there are duplicates, you will need to be smart about adding stuff to the path. There are several ways to be smart about it.

这篇关于"输入线过长"错误bat文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆