Created
June 16, 2015 04:00
-
-
Save toagit/8e5cbd42ca6e4bd96aed to your computer and use it in GitHub Desktop.
変数内の文字列を検索するコマンドのサンプル
This file contains 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
echo off | |
set hoge="aaatestxxx" | |
@echo %hoge% | find "test" > NUL | |
echo %errorlevel% | |
if errorlevel 1 ( | |
echo error!! | |
) else ( | |
echo OK! | |
) | |
@echo %hoge% | find "xtesta" > NUL | |
echo %errorlevel% | |
if errorlevel 1 ( | |
echo error!! | |
) else ( | |
echo OK! | |
) | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment