![](https://batch-file.net/wp-content/themes/cocoon-master/images/b-woman.png)
バッチファイルで
・ユーザーから入力を受け付ける
ことができます!
コード
ここでは例としてユーザーから「名前」の入力を受け付けます。
@echo off
rem 入力の受け付け
set /p userName=名前を入力してください:
echo.
rem 入力内容を出力
echo こんにちは! %userName% さん!
pause
exit
実行結果
ユーザーから入力を受け付けできました。
![実行結果①](https://batch-file.net/wp-content/uploads/2022/11/bat_inpurt_from_user_001.png)
![実行結果②](https://batch-file.net/wp-content/uploads/2022/11/bat_inpurt_from_user_002.png)
参考
上記で使用した以下の詳細は、公式サイトをご確認ください。
●「set」コマンド
※パラメーター「/p」の記載もあります。