@echo off net session >nul 2>&1 if errorlevel 1 echo 管理者として実行していません & pause & goto :eof systeminfo /fo csv /nh 2>&1 | find /i "SERVER" >nul set ofn=%~dp04_options.csv if errorlevel 1 ( powershell -command "Get-WindowsOptionalFeature -Online | Export-Csv """"%ofn%"""" -Encoding Default" if errorlevel 1 dism /online /get-features /format:table > %~dp04_options.txt ) else ( powershell -command "Get-WindowsFeature | Export-Csv """"%ofn%"""" -Encoding Default" if errorlevel 1 dism /online /get-features /format:table > %~dp04_options.txt )