How to tell if a user is running as Administrator?


  1. Posts : 201
    Windows 7 RTM x86/x64
       #1

    How to tell if a user is running as Administrator?


    I am writing a batch file for a group of people that might or might not know how to run as admin. I would like to know if there are any files or varibles that are different for the admin or the current user.
      My Computer


  2. Posts : 28,845
    Win 8 Release candidate 8400
       #2

    abuttino said:
    I am writing a batch file for a group of people that might or might not know how to run as admin. I would like to know if there are any files or varibles that are different for the admin or the current user.
    Hi and welcome

    sure there are tons. group mebership, gpedit, users cpanel, what exactly are you trying to do? Id the ones who are, or arent running as admin?


    Kenn J++
      My Computer


  3. Posts : 5,840
    Vista Ult64, Win7600
       #3

    Well a quick way to see if you are running as the Admin is to click, Start and at the top of the Menu Screen
    click the picture and it willl tell you on the righthand side, I am not sure what you mean in the second part of
    your question, Sorry.


    How to tell if a user is running as Administrator?-capturepp.png
      My Computer


  4. Posts : 31,249
    Windows 11 Pro x64 [Latest Release and Release Preview]
       #4

    abuttino said:
    I am writing a batch file for a group of people that might or might not know how to run as admin. I would like to know if there are any files or varibles that are different for the admin or the current user.

    If you are needing to identify the privilege level of a user programatically and act on this information - I think you would be better looking to write your code in PowerShell rather in a simple batch.

    I believe that PS has all the tools you will need. I have not worked with it personally yet, (it's on my ToDo list ).

    There are a lot of tutorials available on he web and I have seen sites that will help you with specific problems that arise
      My Computers


  5. Posts : 201
    Windows 7 RTM x86/x64
    Thread Starter
       #5

    I am looking to identify the privilege level automatied from the batch file. "If not admin, goto end" kinda thing.
      My Computer


  6. Posts : 31,249
    Windows 11 Pro x64 [Latest Release and Release Preview]
       #6

    As I said above I believe that Powershell will have this type of functionality - but do not have the actual experience with it to guide you further.

    There may be other members here, of course, who do have this knowledge.

    Other than this possibility I can only suggest you check out Microsoft themselves or one of the many tutorials.

    There are many

    As this illustrates ....

    powershell tutorials - Google Search
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:34.
Find Us