REM @@IF NOT EXIST ".env" ( goto :DISPLAY_ERROR )
@@set RCSITLIB_HOME=%CD%
@@set PATH=%PATH%;%RCSITLIB_HOME%\bin;%RCSITLIB_HOME%\lib;%RCSITLIB_HOME%\packages\ThirdParty\bin;
@@set TCLLIBPATH="%RCSITLIB_HOME:\=/%/packages %RCSITLIB_HOME:\=/%/packages/ThirdParty/bin/SpirentTestCenter"
@@echo this scripts permanently sets the environment variables. Use with caution
@@echo - RCSITLIB_HOME to %RCSITLIB_HOME%
@@echo - PATH to %PATH%
@@echo - TCLLIBPATH to %TCLLIBPATH%
@@echo --
@@pause
@@setx RCSITLIB_HOME %RCSITLIB_HOME%
@@setx PATH "%PATH%"
@@setx TCLLIBPATH %TCLLIBPATH%
@@ echo DONE
@@pause
@@GOTO :END
REM :DISPLAY_ERROR
REM @@echo Error. not the right current directory. Run the script from the windows explorer instead
REM @@pause
:END
双击之后,
path环境变量如下:
E:\svnCommand\Subversion Client;C:\Tcl\bin;E:\STAF\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;E:\svn\bin;E:\STAF\jre\bin;C:\Program
最后却是:C:\Program
郁闷,想不通,为什么添加不全,请大侠指教,是不是windows的path有长度限制,如果是的话,请问如何修改?
4 个解决方案
#1
@@set PATH=%PATH%;%RCSITLIB_HOME%\bin;%RCSITLIB_HOME%\lib;%RCSITLIB_HOME%\packages\ThirdParty\bin;
肯定是 空格 的问题。不会是path长度的限制。
试试用引号或其它替代空格的方式
肯定是 空格 的问题。不会是path长度的限制。
试试用引号或其它替代空格的方式
#2
我双击批处理文件之后的界面信息如下:
E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLib\RCATSL\SourceCode>REM
@@IF NOT EXIST ".env" ( goto :DISPLAY_ERROR )
this scripts permanently sets the environment variables. Use with caution
- RCSITLIB_HOME to E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLib\RCA
TSL\SourceCode
- PATH to E:\svnCommand\Subversion Client;C:\Tcl\bin;E:\STAF\bin;C:\WINDOWS\syst
em32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\1
00\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;E:\svn\bin;E:
\STAF\jre\bin;"C:\Program Files\Spirent Communications\Spirent TestCenter 3.42\L
ayer 4-7 Application";"E:\spirentTestCenterApplication\4-7layer\Layer 4-7 Applic
ation";E:\spirentTestCenterApplication\TCL\bin;E:\svnServer\RaisecomAutomatedTes
tingScriptsTools\ScriptLib\RCATSL\SourceCode\packages\Utility\NetworkTesterAPI;E
:\svnCommand\Subversion;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\bin;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\lib;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\packages\ThirdParty\bin;
- TCLLIBPATH to "E:/svnCode/RaisecomAutomatedTestingScriptsTools/ScriptLib/RCATS
L/SourceCode/packages E:/svnCode/RaisecomAutomatedTestingScriptsTools/ScriptLib/
RCATSL/SourceCode/packages/ThirdParty/bin/SpirentTestCenter"
--
请问我如何用引号替代空格?谢谢!
我将代码改成:
@@set PATH="%PATH%";"%RCSITLIB_HOME%\bin";"%RCSITLIB_HOME%\lib";"%RCSITLIB_HOME%\packages\ThirdParty\bin";
之后还是不行。
谢谢!
E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLib\RCATSL\SourceCode>REM
@@IF NOT EXIST ".env" ( goto :DISPLAY_ERROR )
this scripts permanently sets the environment variables. Use with caution
- RCSITLIB_HOME to E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLib\RCA
TSL\SourceCode
- PATH to E:\svnCommand\Subversion Client;C:\Tcl\bin;E:\STAF\bin;C:\WINDOWS\syst
em32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\1
00\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;E:\svn\bin;E:
\STAF\jre\bin;"C:\Program Files\Spirent Communications\Spirent TestCenter 3.42\L
ayer 4-7 Application";"E:\spirentTestCenterApplication\4-7layer\Layer 4-7 Applic
ation";E:\spirentTestCenterApplication\TCL\bin;E:\svnServer\RaisecomAutomatedTes
tingScriptsTools\ScriptLib\RCATSL\SourceCode\packages\Utility\NetworkTesterAPI;E
:\svnCommand\Subversion;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\bin;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\lib;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\packages\ThirdParty\bin;
- TCLLIBPATH to "E:/svnCode/RaisecomAutomatedTestingScriptsTools/ScriptLib/RCATS
L/SourceCode/packages E:/svnCode/RaisecomAutomatedTestingScriptsTools/ScriptLib/
RCATSL/SourceCode/packages/ThirdParty/bin/SpirentTestCenter"
--
请问我如何用引号替代空格?谢谢!
我将代码改成:
@@set PATH="%PATH%";"%RCSITLIB_HOME%\bin";"%RCSITLIB_HOME%\lib";"%RCSITLIB_HOME%\packages\ThirdParty\bin";
之后还是不行。
谢谢!
#3
我的环境变量path被修改为
E:\svnCommand\Subversion Client;C:\Tcl\bin;E:\STAF\bin;C:\WINDOWS\syst
em32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\1
00\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;E:\svn\bin;E:
\STAF\jre\bin;"C:\Program
但是 "C:\Program Files\Spirent Communications\Spirent TestCenter 3.42\L
ayer 4-7 Application";是有引号的啊,为什么还没修改全呢
E:\svnCommand\Subversion Client;C:\Tcl\bin;E:\STAF\bin;C:\WINDOWS\syst
em32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\1
00\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;E:\svn\bin;E:
\STAF\jre\bin;"C:\Program
但是 "C:\Program Files\Spirent Communications\Spirent TestCenter 3.42\L
ayer 4-7 Application";是有引号的啊,为什么还没修改全呢
#4
我这个批处理文件,在有的机器上修改没问题,有的出现修改不全的情况。
#1
@@set PATH=%PATH%;%RCSITLIB_HOME%\bin;%RCSITLIB_HOME%\lib;%RCSITLIB_HOME%\packages\ThirdParty\bin;
肯定是 空格 的问题。不会是path长度的限制。
试试用引号或其它替代空格的方式
肯定是 空格 的问题。不会是path长度的限制。
试试用引号或其它替代空格的方式
#2
我双击批处理文件之后的界面信息如下:
E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLib\RCATSL\SourceCode>REM
@@IF NOT EXIST ".env" ( goto :DISPLAY_ERROR )
this scripts permanently sets the environment variables. Use with caution
- RCSITLIB_HOME to E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLib\RCA
TSL\SourceCode
- PATH to E:\svnCommand\Subversion Client;C:\Tcl\bin;E:\STAF\bin;C:\WINDOWS\syst
em32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\1
00\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;E:\svn\bin;E:
\STAF\jre\bin;"C:\Program Files\Spirent Communications\Spirent TestCenter 3.42\L
ayer 4-7 Application";"E:\spirentTestCenterApplication\4-7layer\Layer 4-7 Applic
ation";E:\spirentTestCenterApplication\TCL\bin;E:\svnServer\RaisecomAutomatedTes
tingScriptsTools\ScriptLib\RCATSL\SourceCode\packages\Utility\NetworkTesterAPI;E
:\svnCommand\Subversion;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\bin;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\lib;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\packages\ThirdParty\bin;
- TCLLIBPATH to "E:/svnCode/RaisecomAutomatedTestingScriptsTools/ScriptLib/RCATS
L/SourceCode/packages E:/svnCode/RaisecomAutomatedTestingScriptsTools/ScriptLib/
RCATSL/SourceCode/packages/ThirdParty/bin/SpirentTestCenter"
--
请问我如何用引号替代空格?谢谢!
我将代码改成:
@@set PATH="%PATH%";"%RCSITLIB_HOME%\bin";"%RCSITLIB_HOME%\lib";"%RCSITLIB_HOME%\packages\ThirdParty\bin";
之后还是不行。
谢谢!
E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLib\RCATSL\SourceCode>REM
@@IF NOT EXIST ".env" ( goto :DISPLAY_ERROR )
this scripts permanently sets the environment variables. Use with caution
- RCSITLIB_HOME to E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLib\RCA
TSL\SourceCode
- PATH to E:\svnCommand\Subversion Client;C:\Tcl\bin;E:\STAF\bin;C:\WINDOWS\syst
em32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\1
00\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;E:\svn\bin;E:
\STAF\jre\bin;"C:\Program Files\Spirent Communications\Spirent TestCenter 3.42\L
ayer 4-7 Application";"E:\spirentTestCenterApplication\4-7layer\Layer 4-7 Applic
ation";E:\spirentTestCenterApplication\TCL\bin;E:\svnServer\RaisecomAutomatedTes
tingScriptsTools\ScriptLib\RCATSL\SourceCode\packages\Utility\NetworkTesterAPI;E
:\svnCommand\Subversion;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\bin;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\lib;E:\svnCode\RaisecomAutomatedTestingScriptsTools\ScriptLi
b\RCATSL\SourceCode\packages\ThirdParty\bin;
- TCLLIBPATH to "E:/svnCode/RaisecomAutomatedTestingScriptsTools/ScriptLib/RCATS
L/SourceCode/packages E:/svnCode/RaisecomAutomatedTestingScriptsTools/ScriptLib/
RCATSL/SourceCode/packages/ThirdParty/bin/SpirentTestCenter"
--
请问我如何用引号替代空格?谢谢!
我将代码改成:
@@set PATH="%PATH%";"%RCSITLIB_HOME%\bin";"%RCSITLIB_HOME%\lib";"%RCSITLIB_HOME%\packages\ThirdParty\bin";
之后还是不行。
谢谢!
#3
我的环境变量path被修改为
E:\svnCommand\Subversion Client;C:\Tcl\bin;E:\STAF\bin;C:\WINDOWS\syst
em32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\1
00\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;E:\svn\bin;E:
\STAF\jre\bin;"C:\Program
但是 "C:\Program Files\Spirent Communications\Spirent TestCenter 3.42\L
ayer 4-7 Application";是有引号的啊,为什么还没修改全呢
E:\svnCommand\Subversion Client;C:\Tcl\bin;E:\STAF\bin;C:\WINDOWS\syst
em32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\1
00\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;E:\svn\bin;E:
\STAF\jre\bin;"C:\Program
但是 "C:\Program Files\Spirent Communications\Spirent TestCenter 3.42\L
ayer 4-7 Application";是有引号的啊,为什么还没修改全呢
#4
我这个批处理文件,在有的机器上修改没问题,有的出现修改不全的情况。