哪里是" START"寻找可执行文件? [英] Where is "START" searching for executables?

查看:203
本文介绍了哪里是" START"寻找可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的公司,我们使用一个批处理文件来启动Matlab的。该批处理文件$ P $开始之前Matlab的ppares环境。

In my company we use a batch-file to start Matlab. The batch-file prepares the environment before starting Matlab.

Matlab的本身开始

Matlab itself is started with

START MATLAB.EXE

我有我的系统上安装Matlab的多个版本。而这个命令启动错误的Matlab的版本。哪里是开始寻找可执行文件?

I have several versions of Matlab installed on my system. And this command is starting the wrong Matlab version. Where is START looking for the executables?

推荐答案

命令的开始查找可执行文件一样的命令行间preTER运行的 CMD.EXE 如果不没有绝对路径时,使用另外在环境变量中列出的扩展名的 PATHEXT 用分号分隔,如果文件扩展名也不翼而飞。

Command start finds executables to run like command line interpreter cmd.exe does if no absolute path is used, using additionally the extensions listed in environment variable PATHEXT separated by semicolons if file extension is also missing.


  1. 当前工作目录。

  1. Current working directory.

为了在 PATH中列出的环境变量的路径的所有目录

All directories of environment variable PATH in order as listed in PATH.

只要输入一个命令提示符窗口设置路径来查看所有目录中的 PATH 以及所有文件中的 PATHEXT <扩展/ STRONG>

Just type in a command prompt window set path to see all directories in PATH as well as all file extensions in PATHEXT.

请注意,每个用户帐户都有自己的 PATH 。因此, PATH 系统帐户通常是一个标准的用户帐户的 PATH 不同。这是在运行使用命令的runas 或通过编写一个批处理文件非常重要调度使用不同的帐户。

Please note that each user account has its own PATH. Therefore PATH of system account is usually different to PATH of a standard user account. That is very important on running a batch file with command runas or via task scheduler using a different account.

福克纳发布批处理文件是非常有帮助这里了。

The batch file posted by Jason Faulkner is very helpful here, too.

开始进一步查找注册表键下

start looks further in registry under the keys

HKEY_CURRENT_USER \\软件\\微软\\的Windows \\ CurrentVersion \\应用程序路径结果
HKEY_CURRENT_USER \\ SOFTWARE \\ Wow6432Node \\微软\\的Windows \\ CurrentVersion \\应用程序路径结果
HKEY_LOCAL_MACHINE \\ SOFTWARE \\微软\\的Windows \\ CurrentVersion \\应用程序路径结果
HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Wow6432Node \\微软\\的Windows \\ CurrentVersion \\应用程序路径

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths
HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths

使用MSI软件包安装的应用程序(嵌入在安装程序的EXE或另行公布)使用 MSIEXEC 已经下注册文件名称的应用程序路径包含可执行名称以完整路径的默认字符串值。常常有一个名为路径第二个字符串值仅包含完整路径应用程序的可执行文件。其他安装程序也注册在应用程序路径的应用程序,看到的应用程序注册

Applications installed with an MSI package (embedded in installer EXE or published separately) using msiexec have their file name registered under App Paths with default string value containing name of executable with full path. There is often a second string value with name Path containing just the full path to the executable of the application. Other installers register an application also in App Paths, see Microsoft article about Application Registration.

应用程序路径 关键注册表配置单元 HKEY_CURRENT_USER 通常不存在作为安装使用受信任的安装程序或本地管理员帐户,因此安装的应用程序的注册做过注册表配置单元<$完成C $ C> HKEY_LOCAL_MACHINE 。但在每个用户安装的 HKCU 路径用于申请注册,而不是一个应用程序的 HKLM 路径。

The App Paths key in registry hive HKEY_CURRENT_USER usually does not exist as installation is done using trusted installer or local administrator account and therefore the registration of the installed application is done in registry hive HKEY_LOCAL_MACHINE. But on a per user installation of an application the HKCU path is used for application registration instead of HKLM path.

应用程序路径下的键只存在Windows x64上的 Wow6432Node 键。但是x86应用程序在注册但通常都应用程序路径虽然 Wow6432Node 是32位应用程序和其它树在Windows 7 X64的64位应用程序,Windows Server 2008中R2 x64和后来的Windows x64。有关详情请参阅Microsoft文章由WOW64 影响注册表项。

The App Paths key under Wow6432Node key exists only on Windows x64. But x86 applications are registered nevertheless usually in both App Paths although Wow6432Node is for 32-bit applications and the other tree for 64-bit applications on Windows 7 x64, Windows Server 2008 R2 x64 and later Windows x64. For details see Microsoft article Registry Keys Affected by WOW64.

还要说明一点:

即使 .exe文件指定的开始的搜索在当前工作目录,以及在 PATH的目录后没有找到 AppName.exe 此外,对于 AppName.exe。* 并检查文件扩展名(最后一期后的字符串)对在文件扩展名的 PATHEXT 如果它返回一个或多个文件名。它仍然是总是更好指定应用程序的文件扩展名,开始为 AppName.exe 搜索总是第一个做的是执行通配符搜索之前,如果 AppName.exe 在当前目录。

Even with .exe specified, start searches in current working directory as well as in directories of PATH after not found AppName.exe additionally for AppName.exe.* and checks file extension (string after last period) against the file extensions in PATHEXT if this returns one or more file names. It is nevertheless always better to specify the file extension of the application to start as a search for AppName.exe is always done first before the wildcard search is executed if AppName.exe in the current directory.

该免费工具进程监视器的Sysinternals(微软)是一个伟大的工具找出这样的事情。

The free tool Process Monitor of Sysinternals (Microsoft) is a great tool to find out things like that.

最后,但对于没有可执行文件并非最不重要的开始检查也HKEY_CLASSES_ROOT的文件关联打开与相关的应用程序命令定义的文件或URI(URL)打开即可。这就是为什么像下面同样适用。

Last but not least for none executables start checks also HKEY_CLASSES_ROOT for a file association to open a file or a URI (URL) with associated application defined for command open. That is the reason why something like below also works.

start MyTextFile.txt
start http://stackoverflow.com/

这篇关于哪里是&QUOT; START&QUOT;寻找可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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