当从批处理中运行缺少依赖项的 EXE 时,我可以捕获错误吗?在这种情况下,EXE 无法加载并且我们的应用程序日志为空
我尝试检查错误级别,甚至尝试使用depends.exe 工具预先检查EXE,但它们都不起作用
即mybat.exe
run-this-app.exe 做一些检查.. 做一些事情
当从批处理中运行缺少依赖项的 EXE 时,我可以捕获错误吗?在这种情况下,EXE 无法加载并且我们的应用程序日志为空
我尝试检查错误级别,甚至尝试使用depends.exe 工具预先检查EXE,但它们都不起作用
即mybat.exe
run-this-app.exe 做一些检查.. 做一些事情
假设您知道依赖项是什么以及位置,那么您可以检查它们。
if not exist "%windir%\system32\dependency1" goto :msg
if not exist "%windir%\system32\dependency2" goto :msg
if not exist "%windir%\system32\dependency3" goto :msg
if not exist "%windir%\system32\dependency4" goto :msg
:: batch code here
goto :EOF
:msg
echo you need the extra xyz filez...