@echo off setlocal set BasePath=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths set Cmd01Key=WMP.exe set Cmd01Run=%ProgramFiles%\Windows Media Player\wmplayer.exe set Cmd01Path=%ProgramFiles%\Windows Media Player set Cmd02Key=N.exe set Cmd02Run=%windir%\notepad.exe set Cmd02Path=%windir% set Cmd03Key=IE.exe set Cmd03Run=%ProgramFiles%\Internet Explorer\iexplore.exe set Cmd03Path=%ProgramFiles%\Internet Explorer if "%1"=="-d" goto DEL :ADD rem コマンドを追加 reg add "%BasePath%\%Cmd01Key%" /ve /d "%Cmd01Run%" /f reg add "%BasePath%\%Cmd01Key%" /v Path /t REG_SZ /d "%Cmd01Path%" /f reg add "%BasePath%\%Cmd02Key%" /ve /d "%Cmd02Run%" /f reg add "%BasePath%\%Cmd02Key%" /v Path /t REG_SZ /d "%Cmd02Path%" /f reg add "%BasePath%\%Cmd03Key%" /ve /d "%Cmd03Run%" /f reg add "%BasePath%\%Cmd03Key%" /v Path /t REG_SZ /d "%Cmd03Path%" /f goto END :DEL rem コマンドを削除 reg delete "%BasePath%\%Cmd01Key%" /va /f reg delete "%BasePath%\%Cmd02Key%" /va /f reg delete "%BasePath%\%Cmd03Key%" /va /f goto END :END taskkill /f /im explorer.exe start explorer.exe endlocal