Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I know if I have Windows administrator rights from command line? Particularly on Windows7?

Is there any equivalent to linux id?

share|improve this question
    
id does not shows the permissions of a user, it shows the id. "administrative rights" can be retrieved by (among others) sudo. then the output of id is meaningless in terms of finding out what the user can do. just as a sidenote. –  akira Sep 14 '12 at 8:06
add comment

1 Answer

up vote 3 down vote accepted

You can run the following script:

`NET SESSION >nul 2>&1
IF %ERRORLEVEL% EQU 0 (
    ECHO Administrator PRIVILEGES Detected! 
) ELSE (
    ECHO NOT AN ADMIN!
)`

By the way, you can start command prompt with administrative privileges:

  1. click on windows icon

  2. type "cmd" without quotes on the search bar

  3. press SHIFT+CONTRL+ENTER

  4. press CTRL+C or click on "yes" when the UAC message appear

I think you didn't do your homework by searching on web, here's the question answered on stackoverflow:

http://stackoverflow.com/questions/4051883/batch-script-how-to-check-for-admin-rights

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.