<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hidari-yori</author_name>
  <author_url>https://blog.hatena.ne.jp/hidari-yori/</author_url>
  <blog_title>HIDARI日記（右）</blog_title>
  <blog_url>https://hidari-lab.hatenablog.com/</blog_url>
  <categories>
    <anon>Windows</anon>
  </categories>
  <description>基本中の基本なんですが、最近はエラーが起こったら処理を終了することが重要になってくるとき、例えば「コマンドプロンプトしか使えない状況でCI回したい」みたいな縛りプレイしてるときに使ってます。具体的にはJenkinsのジョブを失敗させるためですが。 手順 まず、バッチファイルに以下の様なサブルーチンを用意しておきます。 :SuccessOrDie if not %errorlevel% == 0 ( echo [ERROR] :P exit 1 ) exit /b 0 これをerrorlevelに戻り値を返すコマンドのあとにcallで呼び出します。 xcopy src\hoge.dll dest…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhidari-lab.hatenablog.com%2Fentry%2F2016%2F04%2F24%2F113317&quot; title=&quot;コマンドプロンプトの errorlevel を確認してエラーなら処理を終了する方法 - HIDARI日記（右）&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-04-24 11:33:17</published>
  <title>コマンドプロンプトの errorlevel を確認してエラーなら処理を終了する方法</title>
  <type>rich</type>
  <url>https://hidari-lab.hatenablog.com/entry/2016/04/24/113317</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
