<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bat wait &#8211; スグブログ</title>
	<atom:link href="https://sugublog.org/tag/bat-wait/feed/" rel="self" type="application/rss+xml" />
	<link>https://sugublog.org</link>
	<description>ブログ運営について発信中</description>
	<lastBuildDate>Sat, 24 Feb 2024 06:46:48 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://sugublog.org/wp-content/uploads/2021/07/icon_20210703-min-150x150.png</url>
	<title>bat wait &#8211; スグブログ</title>
	<link>https://sugublog.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>【bat】バッチでwait処理を秒数指定する！ミリ秒単位で指定可能</title>
		<link>https://sugublog.org/bat-wait/</link>
					<comments>https://sugublog.org/bat-wait/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[suguru]]></dc:creator>
		<pubDate>Sat, 24 Feb 2024 06:46:47 +0000</pubDate>
				<category><![CDATA[bat]]></category>
		<category><![CDATA[bat wait]]></category>
		<guid isPermaLink="false">https://sugublog.org/?p=6406</guid>

					<description><![CDATA[<p><img src="https://sugublog.org/wp-content/uploads/2021/12/dog202112129-1-1024x766.jpg" class="webfeedsFeaturedVisual" /></p>そういったエンジニアの悩みに現役エンジニアの筆者が答えます。 bat(バッチ)でwait処理したい人はこの記事を読んでください。 batでwait処理を秒数指定する batでwait処理を秒数指定する方法をまとめます。  [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://sugublog.org/wp-content/uploads/2021/12/dog202112129-1-1024x766.jpg" class="webfeedsFeaturedVisual" /></p><div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="blue"><div class="c-balloon__icon -square"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://sugublog.org/wp-content/uploads/2021/02/cropped-dog003-150x150.png" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/02/cropped-dog003-150x150.png" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">bat(バッチ)でwait処理行いたい人</span></div><div class="c-balloon__body -thinking -border-on"><div class="c-balloon__text">
<p>bat(バッチ)でwait処理を行い秒数指定したいです。</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<p>そういったエンジニアの悩みに現役エンジニアの筆者が答えます。</p>


<div class="p-blogParts post_content" data-partsID="5030">
<p>windowsのプロンプトで使用できるbatやpythonやphpを使用して、業務効率化やWebサイトを作成しております。javaやシェルスクリプトなど、様々なプログラミングを行った実績ありの筆者です。</p>
</div>


<p><strong><span class="swl-inline-color has-swl-deep-01-color">bat(バッチ)でwait処理したい人</span></strong>はこの記事を読んでください。</p>



<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle ads" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-9330904718533231" data-ad-slot="6086594686"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>



<h2 class="wp-block-heading">batでwait処理を秒数指定する</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="683" src="https://sugublog.org/wp-content/uploads/2021/12/dog202112129-2-1024x683.jpg" alt="wait" class="wp-image-4830" srcset="https://sugublog.org/wp-content/uploads/2021/12/dog202112129-2-1024x683.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/12/dog202112129-2-300x200.jpg 300w, https://sugublog.org/wp-content/uploads/2021/12/dog202112129-2-768x512.jpg 768w, https://sugublog.org/wp-content/uploads/2021/12/dog202112129-2.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p><strong><span class="swl-inline-color has-swl-deep-01-color">batでwait処理を秒数指定する方法</span></strong>をまとめます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>timeout /t 秒数</code></pre></div>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/10/カスタマイズ1013-1-300x200.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/bat-base-timeout/">【bat基礎】Timeoutの使い方！効かない時の対処法などご紹介</a>
						<span class="p-blogCard__excerpt">時間指定して経過後、続きからbatファイルを動かしたい場合は「Timeout」コマンドを使用します。 batファイルで一時停止させたい場合「Pause」コマンドを使用しますが、&#8230;</span>					</div>
				</div>
			</div>
		</div>


<p>これで指定した秒数だけwaitする事ができます。</p>



<p>では３秒間waitした後に処理を続けるbatを作成します。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>timeout /t 3</code></pre></div>



<p>このbatを実行してみます。</p>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/07/analytics-2-300x157.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/bat-execution/">【bat】バッチを実行する方法！実行できない時の対処法などをご紹介</a>
						<span class="p-blogCard__excerpt">batファイルが既にありそれを実行してと言われたけど、どうやって実行すればわからない人の悩みに答えます。 またbatを実行しようとしたけど、できなかった時の原因と対&#8230;</span>					</div>
				</div>
			</div>
		</div>


<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>3 秒待っています。続行するには何かキーを押してください .</code></pre></div>



<p>秒数がカウントされて、その後に処理が再開されます。</p>


<div class="swell-block-balloon"><div class="c-balloon -bln-left" data-col="blue"><div class="c-balloon__icon -square"><img decoding="async" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="https://sugublog.org/wp-content/uploads/2021/03/dog004-150x150.jpeg" alt="" class="lazyload c-balloon__iconImg" width="80px" height="80px"><noscript><img decoding="async" src="https://sugublog.org/wp-content/uploads/2021/03/dog004-150x150.jpeg" alt="" class="c-balloon__iconImg" width="80px" height="80px"></noscript><span class="c-balloon__iconName">機嫌のいいワンコ</span></div><div class="c-balloon__body -speaking -border-on"><div class="c-balloon__text">
<p>秒数を数えてくれるので、どのくらい待てばよいのか、本当に動いているのかわかるので安心です。</p>
<span class="c-balloon__shapes"><span class="c-balloon__before"></span><span class="c-balloon__after"></span></span></div></div></div></div>


<h2 class="wp-block-heading">wait処理でカウントを表示させない方法</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="632" src="https://sugublog.org/wp-content/uploads/2021/11/programing_1122-3-1024x632.jpg" alt="wait" class="wp-image-4560" srcset="https://sugublog.org/wp-content/uploads/2021/11/programing_1122-3-1024x632.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/11/programing_1122-3-300x185.jpg 300w, https://sugublog.org/wp-content/uploads/2021/11/programing_1122-3-768x474.jpg 768w, https://sugublog.org/wp-content/uploads/2021/11/programing_1122-3.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>カウントさせたくない方法は、先程のコマンドを「>nul」にリダイレクトしましょう。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>timeout /t 3 &gt;nul</code></pre></div>



<p class="is-style-icon_announce">nulはゴミ箱のようなものです。>nullを付けることでメッセージを非表示にする事が可能です。</p>



<p>batを実行してみると、カウントが表示されずに３秒後に後の処理が再開されました。</p>



<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-9330904718533231"
     crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-format="autorelaxed"
     data-ad-client="ca-pub-9330904718533231"
     data-ad-slot="8455594968"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>




<h2 class="wp-block-heading">wait処理をその他の方法で行う</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="683" src="https://sugublog.org/wp-content/uploads/2021/10/moving1006-2-1024x683.jpg" alt="wait" class="wp-image-4235" srcset="https://sugublog.org/wp-content/uploads/2021/10/moving1006-2-1024x683.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/10/moving1006-2-300x200.jpg 300w, https://sugublog.org/wp-content/uploads/2021/10/moving1006-2-768x512.jpg 768w, https://sugublog.org/wp-content/uploads/2021/10/moving1006-2.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>batの上位互換にpowershellというものがあります。</p>



<p>bat上でもpowershellが動きます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>powershell sleep 3</code></pre></div>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>powershell start-sleep -seconds 3</code></pre></div>


<div class="swell-block-postLink">			<div class="p-blogCard -internal" data-type="type1" data-onclick="clickLink">
				<div class="p-blogCard__inner">
					<span class="p-blogCard__caption">あわせて読みたい</span>
					<div class="p-blogCard__thumb c-postThumb"><figure class="c-postThumb__figure"><img decoding="async" src="https://sugublog.org/wp-content/uploads/2022/01/vitamins_0117-3-300x200.jpg" alt="" class="c-postThumb__img u-obf-cover" width="320" height="180"></figure></div>					<div class="p-blogCard__body">
						<a class="p-blogCard__title" href="https://sugublog.org/bat-sleep/">【bat】バッチでsleepコマンドを使用して数秒待つ！失敗する人必見</a>
						<span class="p-blogCard__excerpt">batでsleepコマンドを使用して、ミリ秒単位で処理を止めたい時もあると思います。 今回はsleepコマンドを使用して、batの処理を数秒止めて再開させたいと思います。 ま&#8230;</span>					</div>
				</div>
			</div>
		</div>


<p class="has-border -border01">このようなコマンドでもbatでwait処理をする事が可能です。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sugublog.org/bat-wait/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
