<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ladybug</author_name>
  <author_url>https://blog.hatena.ne.jp/ladybug/</author_url>
  <blog_title>is BUG Ready ?</blog_title>
  <blog_url>https://ladybug.hatenadiary.org/</blog_url>
  <categories>
    <anon>dev</anon>
  </categories>
  <description>Windows のコマンドプロンプト CMD において、環境変数に遅延展開というものがあることを知ってる人も多いと思う。 CMD は、コマンドを１ステートメントづつ実行するため、IF 文や FOR 文の中で環境変数を扱うと、嬉しくないことが起こる。たとえば、 SET a=1 SET b=1 IF &quot;%a%&quot;==&quot;1&quot; ( SET b=2 ECHO a=%a%, b=%b% ……(x) ) ELSE ( ECHO a=%a%, b=%b% ) ECHO a=%a%, b=%b%このようなバッチスクリプトを実行すると、 1: SET a=1 2: SET b=1 3: IF &quot;1&quot;==&quot;1&quot; ( …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fladybug.hatenadiary.org%2Fentry%2F20090530%2Fp1&quot; title=&quot; 遅延展開される CMD バッチスクリプトで ! を記述する方法 - is BUG Ready ?&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>2009-05-30 00:00:00</published>
  <title> 遅延展開される CMD バッチスクリプトで ! を記述する方法</title>
  <type>rich</type>
  <url>https://ladybug.hatenadiary.org/entry/20090530/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
