将 ERRORLEVEL 重置为零的最简单方法是什么? [英] What is the easiest way to reset ERRORLEVEL to zero?

查看:30
本文介绍了将 ERRORLEVEL 重置为零的最简单方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个为 c# 项目运行一些命令的构建后事件.最后一条命令有时会导致 ERRORLEVEL 值不为零,然后构建失败.

I have a post-build event that runs some commands for a c# project. The last command would sometimes cause the ERRORLEVEL value not equals to zero and then the build fails.

我想附加一行额外的命令以始终将 ERRORLEVEL 值设置为零.最方便的方法是什么?

I want to append an extra line of command to always set the ERRORLEVEL value to zero. What is the most convenient way to do that?

推荐答案

我发现exit 0"看起来是处理这个问题的好方法.

I found that "exit 0" looks like a good way to deal with this problem.

用法示例:

NET STOP UnderDevService/Y

NET STOP UnderDevService /Y

退出 0

如果未启动 UnderDevService 服务.

if the UnderDevService service is not started.

这篇关于将 ERRORLEVEL 重置为零的最简单方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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