Can I detect if I'm running with elevated (administrator) privileges from a batch file script? RRS feed

  • Question

  • I have a script that only works correctly if run as administrator.  I don't need or want to have the script try to automatically elevate... I just want to be able to have the script detect if it is running as administrator, so it can print out an error message and exit cleanly if it's not.

    Is it possible in a normal Vista command script file (*.cmd)?

    Monday, August 24, 2009 4:20 PM