[英]Why does a program started by a batch file using command start not run while it runs via Windows Explorer?
::Checks if there is a JRE installed
start "%USERPROFILE%\Downloads\ConfCompiler\Tools\CheckJre.exe"
When I copy and paste the file location above into Windows Explorer it works fine. 当我将上面的文件位置复制并粘贴到Windows资源管理器中时,它可以正常工作。 But the program does not run from the batch file I have created. 但是该程序无法从我创建的批处理文件中运行。
The purpose of CheckJre.exe
is to create new keys inside of HKEY_CURRENT_USER. CheckJre.exe
的目的是在HKEY_CURRENT_USER内部创建新密钥。
The keys are created when I simply run it from Windows Explorer. 只需在Windows资源管理器中运行它们即可创建密钥。 But the keys are NOT created when running it from the batch file. 但是,从批处理文件运行时不会创建密钥。 The batch file just results in displaying a command prompt window with showing CheckJre.exe
with full path in title bar. 批处理文件仅会导致显示命令提示符窗口,并在标题栏中显示带有完整路径的CheckJre.exe
。
Does anyone have a hint why? 有人暗示为什么吗?
Command start
interprets the first double quoted string as title for the command line window to open. Command start
将第一个双引号字符串解释为要打开的命令行窗口的标题。 For all options of command start
enter in a command prompt window either start /?
对于命令start
所有选项,请在命令提示符窗口中输入start /?
or help start
. 或help start
。
You need to explicitly specify a title in your batch file because of the double quoted string to run CheckJre.exe
. 您需要在批处理文件中显式指定标题,因为要使用双引号引起来的字符串来运行CheckJre.exe
。
Use in batch file: 在批处理文件中使用:
start "Check JRE" "%USERPROFILE%\Downloads\ConfCompiler\Tools\CheckJre.exe"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.