如果可执行文件的路径不在光盘C上,则Windows PATH变量不起作用

时间:2015-02-22 19:11:40

标签: windows path cmd

我需要设置Windows环境变量PATH才能使用控制台中的某些可执行文件。

我在PATH变量中编写了可执行文件的路径,但它不起作用,认为是因为可执行文件不在路径“C:\ Program Files”,而是在磁盘D上,因为在这一天之前,我没有遇到过这样的问题。我该如何解决这个问题?

P.S。如果它有意义,我为Android开发设置了NDK。

PATH=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Autodesk\Alias2014\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Lucidlogix Technologies\VIRTU MVP;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Java\jdk1.8.0_05;C:\Program Files\doxygen\bin;D:\sdks\Android\ndk

另外:

此外,当准确地将目录更改为目标文件夹并键入命令时,我得到相同的结果!奇怪的是:

当我输入它时,我收到相同的错误消息。而且,当准确地将目录更改为此文件夹并键入命令时,我得到相同的结果!它很奇怪。

D:\sdks\Android\ndk>dir
Том в устройстве D имеет метку Scrat's Projects
Серийный номер тома: 8297-302E

Содержимое папки D:\sdks\Android\ndk  

12.11.2014  04:26             9 820 ndk-build  
11.02.2014  04:20               292 ndk-build.cmd  
13.07.2014  12:11           198 144 ndk-depends.exe  
...
13.07.2014  12:11           880 640 ndk-stack.exe  
...
              14 файлов      1 154 110 байт  
              10 папок  726 615 486 464 байт свободно  

D:\sdks\Android\ndk>ndk_build  
"ndk_build" is not recognized as an internal or external command, 
operable program or batch file.

D:\sdks\Android\ndk>ndk_stack  
"ndk_stack" is not recognized as an internal or external command, 
operable program or batch file. 

D:\sdks\Android\ndk>ndk_stack.exe  
"ndk_stack.exe" is not recognized as an internal or external command, 
operable program or batch file.

转储:

ADSK_3DSMAX_x64_2012=C:\Program Files\Autodesk\3ds Max 2012\
ALLUSERSPROFILE=C:\ProgramData
ANS_OLD_ATTACH=1
APPDATA=C:\Users\SCRAT1995\AppData\Roaming
CM2012DIR=C:\Program Files (x86)\Common Files\Autodesk Shared\Materials\
CM2013DIR=C:\Program Files (x86)\Common Files\Autodesk Shared\Materials\
CM2015DIR=C:\Program Files (x86)\Common Files\Autodesk Shared\Materials\
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=SCRAT1995-ПК
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\SCRAT1995
ILBDIR=C:\Program Files (x86)\Common Files\Autodesk Shared\Materials\
ILLDIR=C:\Program Files (x86)\Common Files\Autodesk Shared\Materials\
ILMDIR=C:\Program Files (x86)\Common Files\Autodesk Shared\Materials\
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05
KEYSHOT_EXTERNAL_LICENSE_FOLDER=C:\Program Files\DesignSpark\DesignSpark Mechanical 2.0\
LOCALAPPDATA=C:\Users\SCRAT1995\AppData\Local
LOGONSERVER=\\SCRAT1995-ПК
NPTRACKINGTOOLS_INC=C:\Program Files\OptiTrack\Motive\inc
NPTRACKINGTOOLS_LIB=C:\Program Files\OptiTrack\Motive\lib
NUMBER_OF_PROCESSORS=8
OS=Windows_NT
Path=C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Autodesk\Alias2014\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Lucidlogix Technologies\VIRTU MVP;C:\Program Files (x86)\Autodesk\Backburner\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft Windows Performance Toolkit\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Java\jdk1.8.0_05;C:\Program Files\doxygen\bin;D:/sdks/Android/ndk
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 62 Stepping 4, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3e04
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\SCRAT1~1\AppData\Local\Temp
TMP=C:\Users\SCRAT1~1\AppData\Local\Temp
USERDOMAIN=SCRAT1995-ПК
USERNAME=SCRAT1995
USERPROFILE=C:\Users\SCRAT1995
VBOX_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
VRAY_METASL_PATH_MSL12=C:\Program Files\Chaos Group\V-Ray\3dsmax 2012 for x64/metasl/msl12
VRAY_RT_FOR_3DSMAX2012_MAIN_x64=C:\Program Files\Chaos Group\V-Ray\RT for 3ds Max 2012 for x64/bin
VRAY_RT_FOR_3DSMAX2012_PLUGINS_x64=C:\Program Files\Chaos Group\V-Ray\RT for 3ds Max 2012 for x64/bin/plugins
VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
VS120COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\
windir=C:\Windows
windows_tracing_flags=3
windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log

1 个答案:

答案 0 :(得分:3)

检查PathExt变量。

你的道路太复杂了。它在第一次错误时停止。

另外,没有什么可以阻止你输入完整路径。

我的路径声明中有一条额外的路径是不标准的。

PATHEXT = .COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS; .JSE; .WSF; .WSH; .MSC; .LNK; .URL

[编辑:从评论中移出答案]

程序名称包含 - ,但您输入的是 _