Last active
February 11, 2018 11:23
-
-
Save 27Cobalter/1868fa5047d796878917ce99ebfb583d to your computer and use it in GitHub Desktop.
特定ディレクトリ内のファイルを検索してpeceでセレクトしてWMPで再生するやつ
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
@echo off | |
rem pecoをのバイナリをダウンロードしてPATHに追加してhttps://github.com/peco/peco/releases | |
chcp 65001 | |
:LOOP | |
for /F "delims=*" %%a in ('where /r "E:\Sound" *.wav *.mp3 *.mp4 ^| peco ') do @set WAVPATH=%%a | |
if "%WAVPATH%"=="""" goto LOOP | |
echo 再生中: %WAVPATH% | |
rem 昔の直接WMPを呼び出していたパターン | |
rem "C:\Program Files (x86)\Windows Media Player\wmplayer.exe" /play /close "%WAVPATH%" | |
rem /hiddenをつけるとウィンドウが隠れる | |
rem "E:\VisualStudio2017\WMPhandler\WMPhandler\bin\Debug\WMPhandler.exe" "%WAVPATH%" /hidden | |
"E:\VisualStudio2017\WMPhandler\WMPhandler\bin\Debug\WMPhandler.exe" "%WAVPATH%" | |
set WAVPATH="" | |
goto LOOP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment