Last active
January 13, 2016 03:46
-
-
Save maijou2501/65cf941b1e49d0e8a169 to your computer and use it in GitHub Desktop.
引数指定・ドラッグ&ドロップされたテキストファイルを、S-JIS に上書き変換するバッチファイル
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 | |
REM ------------------------------------------------------------------------------------------ | |
REM 引数指定・ドラッグ&ドロップされたテキストファイルを、S-JIS に上書き変換するバッチファイル | |
REM | |
REM Windows用の "nkf.exe" が使えることを前提に、引数指定・ドラッグ&ドロップされたファイルを、 | |
REM S-JIS ファイルエンコーディングに上書き変換するバッチファイルです。 | |
REM | |
REM @file text2sjis.bat | |
REM @author ito | |
REM @date 2016/01/13 | |
REM @version 1.0 | |
REM ------------------------------------------------------------------------------------------ | |
REM "nkf.exe" の絶対パスを設定する | |
REM [ nkf.exe nkf32.dll Windows用のダウンロード : Vector ソフトを探す! ]( http://www.vector.co.jp/soft/dl/win95/util/se295331.html ) | |
SET NKF="C:\Windows\System32\nkf32.exe" | |
REM ファイル確認 | |
IF EXIST %NKF% (GOTO FILE_TRUE) ELSE GOTO FILE_FALSE | |
REM "nkf.exe" が無かった場合 | |
:FILE_FALSE | |
ECHO %NKF% : No such file or directory | |
PAUSE | |
GOTO BAT_END | |
REM "nkf.exe" が存在していた場合 | |
:FILE_TRUE | |
FOR %%1 IN (%*) DO ( | |
IF EXIST %%1 ( | |
%NKF% --overwrite -s %%1 | |
) ELSE ( | |
ECHO %%1 : No such file or directory | |
) | |
) | |
GOTO BAT_END | |
:BAT_END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment