Created
June 22, 2011 00:46
-
-
Save froop/1039293 to your computer and use it in GitHub Desktop.
[bat] ファイルから入力した各行に同じ処理をするサンプル for Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set LIST_FILE=list.txt | |
| set TARGET_PROC=sample.bat | |
| rem カレントディレクトリを保存 | |
| for /F %%a in ('cd') do set ROOT_DIR=%%a | |
| rem ファイルの行数分繰り返し | |
| for /F %%i in (%LIST_FILE%) do call :loop %%i | |
| goto :end | |
| rem ループの中身 | |
| :loop | |
| cd %1 | |
| if errorlevel 1 goto :end | |
| call %TARGET_PROC% | |
| if errorlevel 1 goto :end | |
| cd %ROOT_DIR% | |
| exit /b | |
| :end | |
| cd %ROOT_DIR% | |
| pause | |
| exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment