【发布时间】:2020-12-19 11:43:25
【问题描述】:
我想在批处理文件中运行一些命令并使用 if 语句。
@echo off
call npm install
echo node js instaled
if not errorlevel 1 (
call composer install
if not errorlevel 1 (
echo commands run success.
) else (
echo please install composer and then run this batch again.
)
) else (
echo you have not nodejs in your system. please install nodejs.
)
当我在 npm install 完成后运行这个批处理文件时说
node js installed
if was unexpected at this time.
如何检查命令的成功和失败,然后运行其他命令。
【问题讨论】:
标签: batch-file command npm-install