Whoops. With fsutil, the /? shouldn't be specified. i.e. just `fsutil`
without any command line argument.
Another alternative which is longer to type but not without advantages, is
to simply check the content of the `systemprofile` folder. e.g.
@echo off
if exist %systemroot%\system32\config\systemprofile\* (
echo elevated
) else (
echo not elevated
)
Or try going into that folder...
@echo off
2>nul pushd %systemroot%\system32\config\systemprofile
if errorlevel 1 (
echo not elevated
) else (
popd
echo elevated
)
The advantages of checking that folder is because it's faster than executing
a tool. And a tool may be blocked by group policy, or be excluded by
debloater software from the OS installer to create a minimal OS installation
which is intended to only do specific thing.