Quick Admin Check with Version info for Windows in Batch

A little script which checks for your Version and also tells you if you have Admin rights or not.

@echo off

rem ***************************************
rem Info: http://en.wikipedia.org/wiki/Ver_(command)
rem ***************************************

ver | findstr "DOSBox version 0.72. Reported DOS version 5.0.">nul && echo DOSBox
ver | findstr "Windows NT. Version 4.0">nul && echo Windows NT
ver | findstr "Microsoft Windows 2000 [Version 5.00.2195]">nul && echo Windows 2000
ver | findstr "Microsoft Windows XP [Version 5.1.2600]">nul && echo Windows XP
ver | findstr "Microsoft Windows [Version 5.2.3790]">nul && echo Windows Server 2003 or XP 64bit
ver | findstr "Microsoft Windows [Version 6.0.6001]">nul && echo Windows Vista
ver | findstr "Microsoft Windows [Version 6.0.6002]">nul && echo Windows Server 2008
ver | findstr "Microsoft Windows [Version 6.1.7600]">nul && echo Windows Server 2008 R2 or Windows 7 SP0
ver | findstr "Microsoft Windows [Version 6.1.7601]">nul && echo Windows 7 SP1
ver | findstr "Microsoft Windows [Version 6.2.9200]">nul && echo Windows 8

(mkdir %windir%system32test 2>nul && rmdir %windir%system32test) || goto error
echo User has admin rights
goto End

:Error
echo User has *NO* admin rights
goto End

:End
pause>nul

 

Leave a Reply

Your email address will not be published. Required fields are marked *