简体   繁体   English

为什么通过批处理文件使用命令start启动的程序在通过Windows资源管理器运行时无法运行?

[英]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.

相关问题 为什么在 Windows 上运行 `flask run` 会导致“flask 不是内部或外部命令、可运行程序或批处理文件” - Why does running `flask run` on Windows result in "flask is not recognized as an internal or external command, operable program or batch file" 批处理“启动”命令不起作用…Windows打开..但没有任何运行 - batch “start” command does not work… windows opens.. but nothing runs java 程序通过 windows 控制台启动时不写入文件 - java program does not write to file when started via windows console Windows批处理文件-程序关闭后如何在批处理文件中未启动的命令执行 - Windows batch file - how to execute command after program close that's not started in the batch file t-sql脚本使用命令提示符在批处理文件中运行,但不会通过jenkins运行 - t-sql script runs through batch file using command prompt but same does not run through jenkins 使用带有传递给启动程序的参数的“start”命令 - Using the "start" command with parameters passed to the started program 如何使用带有空格的路径和命令的“start”在Windows中创建批处理文件 - How to create batch file in Windows using “start” with a path and command with spaces 如何使用将暂停执行直到域启动的批处理文件在 Windows 中启动 Glassfish 服务? - How to start Glassfish service in Windows using batch file that will pause execution untill domain is started? 如何使用START命令启动批处理文件的返回/退出代码? - How to get return/exit code of a batch file started with START command? 使用Windows批处理文件启动Java程序 - Use Windows Batch File to start a Java program
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM