このwikiHowでは、Windowsのコマンドラインを使用してバッチファイル(.BAT)を実行する方法を説明します。 「実行」ダイアログボックスまたは「ターミナル」ウィンドウにコマンドを入力してプログラムを実行できます。 ステップ方法1方法1/2: 実行ダイアログボックスの使用- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/b\/be\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-1.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-1.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/b\/be\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-1.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-1.jpg","smallWidth":460,"smallHeight":346,"bigWidth":728,"bigHeight":547,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 1Win + Rキーの組み合わせを押して、「実行」ダイアログボックスを開きます。
- 管理者としてバッチ ファイルを実行する必要がある場合は、この方法を参照してください。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/9\/94\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-2.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-2.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/9\/94\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-2.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-2.jpg","smallWidth":460,"smallHeight":343,"bigWidth":728,"bigHeight":543,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 2クリックして参照します。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/a\/a0\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-3.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-3.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/a\/a0\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-3.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-3.jpg","smallWidth":460,"smallHeight":351,"bigWidth":728,"bigHeight":555,"licensing":" class=\"mw-parser-output\"><\/div>"} 3バッチファイルが保存されているフォルダーに移動します。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/6\/6a\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-4.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-4.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/6\/6a\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-4.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-4.jpg","smallWidth":460,"smallHeight":348,"bigWidth":728,"bigHeight":550,"licensing":" class=\"mw-parser-output\"><\/div>"} 4バッチファイルをクリックして選択すると、強調表示されます。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/b\/b5\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-5.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-5.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/b\/b5\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-5.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-5.jpg","smallWidth":460,"smallHeight":348,"bigWidth":728,"bigHeight":550,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 5クリックして開きます。これにより、バッチ ファイルへの完全なパスが [実行] ダイアログ ボックスに貼り付けられます。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/7\/7c\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-6.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-6.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/7\/7c\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-6.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-6.jpg","smallWidth":460,"smallHeight":347,"bigWidth":728,"bigHeight":549,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 6 「OK」をクリックします。 「ターミナル」ウィンドウでバッチファイルを開き、プログラムを実行します。実行が終了すると、ウィンドウの下部に「続行するには任意のキーを押してください」という行が表示されます。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/1\/17\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-7.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-7.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/1\/17\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-7.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-7.jpg","smallWidth":460,"smallHeight":342,"bigWidth":728,"bigHeight":541,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 7コマンドを実行した後、任意のキーを押して「ターミナル」ウィンドウを閉じます。広告する
方法2方法2/2: ターミナルウィンドウを使用する- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/e\/e0\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-8.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-8.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/e\/e0\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-8.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-8.jpg","smallWidth":460,"smallHeight":342,"bigWidth":728,"bigHeight":542,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 1クリック{"smallUrl":"https:\/\/www.wikihow.com\/images_en\/0\/07\/Windowsstart.png","bigUrl":"https:\/\/www.wikihow.com\/images\/thumb\/0\/07\/Windowsstart.png\/30px-Windowsstart.png","smallWidth":460,"smallHeight":460,"bigWidth":30,"bigHeight":30,"licensing":"<div class=\"mw-parser-output\"><\/div>"}スタート メニュー。通常は画面の左下隅にあります。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/5\/5b\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-9.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-9.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/5\/5b\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-9.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-9.jpg","smallWidth":460,"smallHeight":341,"bigWidth":728,"bigHeight":540,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 2検索バーに「cmd」と入力すると、一致する検索結果が一覧表示されます。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/9\/99\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-10.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-10.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/9\/99\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-10.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-10.jpg","smallWidth":460,"smallHeight":344,"bigWidth":728,"bigHeight":544,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 3 コマンドプロンプトを右クリックします。メニューが展開されます。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/2\/22\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-11.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-11.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/2\/22\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-11.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-11.jpg","smallWidth":460,"smallHeight":344,"bigWidth":728,"bigHeight":545,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 4「 管理者として実行」をクリックします。確認メッセージが表示されます。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/d\/dd\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-12.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-12.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/d\/dd\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-12.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-12.jpg","smallWidth":460,"smallHeight":345,"bigWidth":728,"bigHeight":546,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 5 「OK」をクリックします。最高権限(管理者)でコマンド ラインを開きます。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/3\/34\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-13.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-13.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/3\/34\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-13.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-13.jpg","smallWidth":460,"smallHeight":343,"bigWidth":728,"bigHeight":543,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 6 CD ファイルとバッチ ファイルの完全なパスを入力します。例えば:
- ファイルがデスクトップにある場合は、 cd \Users\ログイン名\Desktopと入力します。
- ダウンロード フォルダーにいる場合は、 cd \Users\ログイン名\Downloadsと入力します。
- ログイン名がわからない場合は、 「cd \Users」と入力してEnter キーを押してUsers フォルダーに移動し、 「dir」と入力してEnter キーを押してログインの一覧を表示します。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/4\/4d\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-14.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-14.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/4\/4d\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-14.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-14.jpg","smallWidth":460,"smallHeight":342,"bigWidth":728,"bigHeight":541,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 7 Enter キーを押してディレクトリに入ります。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/0\/00\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-15.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-15.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/0\/00\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-15.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-15.jpg","smallWidth":460,"smallHeight":346,"bigWidth":728,"bigHeight":547,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 8バッチファイルの名前を入力します。ファイル名が「program.bat」の場合は、「 program.bat 」と入力します。
- 名前がわからない場合は、 「dir」と入力してEnter キーを押して、フォルダー内のファイルを参照します。ここでファイル名を確認できます。
- {"smallUrl":"https:\/\/www.wikihow.com\/images_en\/thumb\/3\/35\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-16.jpg\/v4-460px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-16.jpg","bigUrl":"https:\/\/www.wikihow.com\/i mages\/thumb\/3\/35\/Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-16.jpg\/v4-728px-Run-a-Batch-File-from-the-Command-Line-on-Windows-Step-16.jpg","smallWidth":460,"smallHeight":342,"bigWidth":728,"bigHeight":541,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 9Enter キーを押してバッチ ファイルを実行します。広告する
|