Code: Select all
for /f "tokens=3 delims=\ " %%a in ( '
call "%SystemRoot%\system32\whoami.exe" /groups ^| findstr /b /c:"Mandatory Label"
' ) do if /i "%%~a" == "system" (
echo:system
) else if /i "%%~a" == "high" (
echo:admin
) else if /i "%%~a" == "medium" (
echo:user
) else (
echo:others
)
Early I found that the command chcp 65001 can help in some cases and revert output to English. But no in this case.
Can you give your clues how to fix the issue or suggest another locale-independent way to recognize privileges in the current terminal?