0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

指定フォルダ内にある全てのファイル名を取得するバッチ

Last updated at Posted at 2021-08-25

説明

指定フォルダ内にある全てのファイル名を取得する

exec.bat
@echo off
@REM /s:サブフォルダ検索 /r:正規表現 /i:大文字、小文字区別なし
@REM utf-8表示
chcp 65001

set /p IN="フォルダパスを入力してください(サブフォルダは全て検索対象):"
set /p IN2="対象としたいファイル名を入力:"

dir /b /s %IN% >> path.txt

for /f %%a in (path.txt) do (
    echo %%a|find "%IN2%" >> log.txt
)

pause
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?