<?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 exe &#8211; スグブログ</title>
	<atom:link href="https://sugublog.org/tag/bat-exe/feed/" rel="self" type="application/rss+xml" />
	<link>https://sugublog.org</link>
	<description>ブログ運営について発信中</description>
	<lastBuildDate>Fri, 23 Feb 2024 17:25:37 +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 exe &#8211; スグブログ</title>
	<link>https://sugublog.org</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>【bat】バッチでexeを実行する方法を教えます！引数など使用あり</title>
		<link>https://sugublog.org/bat-exe/</link>
					<comments>https://sugublog.org/bat-exe/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[suguru]]></dc:creator>
		<pubDate>Fri, 23 Feb 2024 17:25:36 +0000</pubDate>
				<category><![CDATA[bat]]></category>
		<category><![CDATA[bat exe]]></category>
		<guid isPermaLink="false">https://sugublog.org/?p=6387</guid>

					<description><![CDATA[<p><img src="https://sugublog.org/wp-content/uploads/2021/11/DB_1114-5-1024x682.jpg" class="webfeedsFeaturedVisual" /></p>batの中でexeファイルを実行したいと思った事はないでしょうか？ batの途中でexeファイルを実行して、何らかの処理をしてから続きのbat処理を行えると業務の幅が広がります。 でも難しそうですよね。でも大丈夫です。  [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img src="https://sugublog.org/wp-content/uploads/2021/11/DB_1114-5-1024x682.jpg" class="webfeedsFeaturedVisual" /></p>
<p><span class="swl-marker mark_orange"><strong><span class="swl-inline-color has-swl-deep-01-color">bat</span></strong>の中で<strong><span class="swl-inline-color has-swl-deep-01-color">exeファイル</span></strong>を<strong>実行したい</strong></span>と思った事はないでしょうか？</p>



<p>batの途中でexeファイルを実行して、何らかの処理をしてから続きのbat処理を行えると業務の幅が広がります。</p>



<p>でも難しそうですよね。でも大丈夫です。</p>



<p>現役エンジニアの筆者がbatでexeファイルの実行の仕方を丁寧に解説します。</p>


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


<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でexeを実行する方法</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/08/DB0804-5-1024x683.jpg" alt="exeを実行" class="wp-image-3844" srcset="https://sugublog.org/wp-content/uploads/2021/08/DB0804-5-1024x683.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/08/DB0804-5-300x200.jpg 300w, https://sugublog.org/wp-content/uploads/2021/08/DB0804-5-768x512.jpg 768w, https://sugublog.org/wp-content/uploads/2021/08/DB0804-5.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p><strong><span class="swl-inline-color has-swl-deep-01-color"><span class="swl-fz u-fz-l">batの中でexeファイルを起動する方法</span></span></strong>をまとめます。</p>



<div class="swell-block-capbox cap_box is-style-onborder_ttl"><div class="cap_box_ttl"><span>batの中でexeファイルを起動する方法2選</span></div><div class="cap_box_content">
<ul class="wp-block-list">
<li>callコマンドでexeを起動する</li>



<li>startコマンドでexeを起動する</li>
</ul>
</div></div>



<h2 class="wp-block-heading">callコマンドでexeを起動する</h2>



<p><strong>callコマンド</strong>はbatファイルの中でラベルをつけたところに移動する事が出来たり、外部のファイルを呼び出したりするコマンドですが、<strong><span class="swl-inline-color has-swl-deep-01-color">exe</span>も起動する事</strong>ができます。</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/09/code_0923-4-300x169.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-call/">【bat】バッチでcallの使い方！gotoやstartとの違いについて</a>
						<span class="p-blogCard__excerpt">batでcallの使い方について教えます。 似たコマンドの「goto」や「start」がありますが、どのように使い分けたら良いのですか？ そう言った疑問にも現役エンジニアの筆&#8230;</span>					</div>
				</div>
			</div>
		</div>


<p>callでexeを起動する時の基礎構文をお伝えします。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>call &quot;exeファイルの絶対パス&quot;</code></pre></div>



<p>これでexeを起動する事ができます。</p>



<h2 class="wp-block-heading">startコマンドでexeを起動する</h2>



<p>次は<strong>startコマンド</strong>です。batでstartコマンドはフォルダを開いたり、他のアプリケーションを起動できるので<span class="swl-marker mark_orange"><strong><span class="swl-inline-color has-swl-deep-01-color">exe</span></strong>を指定して起動できます。</span></p>



<p>startでexeを起動する時の基礎構文をお伝えします。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>start &quot;&quot; &quot;exeファイルの絶対パス&quot;</code></pre></div>



<p>startの基礎構文はstartの後に「ウィンドウタイトル」が来て、その次に対象を書くので最初の&#8221;&#8221;はウィンドウタイトルを空白にして実行するという意味です。</p>



<p>また環境変数でパスが通っているのであれば、exeファイルを指定するだけでも可能です。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>start exeファイル名</code></pre></div>



<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">実践：batでexeを起動してみる</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="614" src="https://sugublog.org/wp-content/uploads/2021/11/programing_shool1121-4-1024x614.jpg" alt="training" class="wp-image-4544" srcset="https://sugublog.org/wp-content/uploads/2021/11/programing_shool1121-4-1024x614.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/11/programing_shool1121-4-300x180.jpg 300w, https://sugublog.org/wp-content/uploads/2021/11/programing_shool1121-4-768x461.jpg 768w, https://sugublog.org/wp-content/uploads/2021/11/programing_shool1121-4.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>実際に<span class="swl-bg-color has-swl-deep-02-background-color">batファイルを使用してexeを起動</span>してみます。</p>



<h3 class="wp-block-heading">batのcallコマンドでexeを起動してみる</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>@echo off
call &quot;C:\Program Files\Google\Chrome\Application\chrome.exe&quot;</code></pre></div>



<p class="is-style-dent_box">「@echo off」について詳しく知りたい方は以下の記事へどうぞ</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/12/PC教室20211216-8-300x229.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-echo-off/">【bat基礎】バッチで「@echo off」の意味や効果とは？</a>
						<span class="p-blogCard__excerpt">batファイルの初めに「@echo off」という記載があると思いますが、この意味は何でしょうか？ なんの効果があるのでしょうか？「@echo off」が無ければどうなるのでしょ&#8230;</span>					</div>
				</div>
			</div>
		</div>


<p>このbatを実行するとgoogle chromeのブラウザが立ち上がります。</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>


<h3 class="wp-block-heading">batのstartコマンドでexeを起動してみる</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>@echo off
start &quot;&quot; &quot;C:\Program Files\Google\Chrome\Application\chrome.exe&quot;</code></pre></div>



<p class="has-border -border01">このbatを実行してもgoogle chromeのブラウザが立ち上がります。</p>



<p>環境変数が通っているので下のコマンドでも立ち上がります。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>@echo off
start &quot;&quot; &quot;chrome.exe&quot;</code></pre></div>



<h2 class="wp-block-heading">実践：batでexeを引数も使用して起動してみる</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img decoding="async" width="1024" height="544" src="https://sugublog.org/wp-content/uploads/2021/11/programing_school1123-6-1024x544.jpg" alt="引数を使用してexe実行" class="wp-image-4583" srcset="https://sugublog.org/wp-content/uploads/2021/11/programing_school1123-6-1024x544.jpg 1024w, https://sugublog.org/wp-content/uploads/2021/11/programing_school1123-6-300x159.jpg 300w, https://sugublog.org/wp-content/uploads/2021/11/programing_school1123-6-768x408.jpg 768w, https://sugublog.org/wp-content/uploads/2021/11/programing_school1123-6.jpg 1200w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</div>


<p>今度は<span class="swl-bg-color has-swl-deep-02-background-color">exeを引数を用いて起動</span>してみます。</p>



<h3 class="wp-block-heading">引数指定してcallコマンドでexeを起動</h3>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>call &quot;C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE&quot; test.xlsx</code></pre></div>



<p>excelのexeファイルを絶対パスで指定して、その後にファイル名を引数として実行します。</p>



<p class="has-border -border01">するとtest.xlsxファイルがexcelで開きました。</p>



<h3 class="wp-block-heading">引数指定してstartコマンドでexeを起動</h3>



<p>同じ事をstartでもやってみます。</p>



<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>start &quot;&quot; &quot;C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE&quot; 35_php.xlsx</code></pre></div>



<p class="has-border -border01">同じ様にtest.xlsxファイルがexcelで開きました。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sugublog.org/bat-exe/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
