Runas to run as administrator


  1. Posts : 3
    Windows 10
       #1

    Runas to run as administrator


    How can I get "runas" to really run as admin ?

    For example:

    "runas /user:administrator some-script.cmd"

    is not the same as right-click and "run as administrator".

    The latter works fine, but "runas /user:administrator" does not. I have tried various combinations of "runas" command line parameters but it does not work.
      My Computer


  2. Posts : 2,923
    Windows 10 Pro for the Bro
       #2

    Try putting the quotation opener after the word administrator:


    Runas to run as administrator-image.png


    (source of where I got this from: Windows runas command syntax and examples )
      My Computer


  3. Posts : 456
    Windows 10
       #3

    Use task scheduler, with the option: Run with highest privileges, and an admin user...
      My Computer


  4. Posts : 16,966
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #4

    shares said:
    runas /user:administrator some-script.cmd
    ... but "runas /user:administrator" does not. I have tried various combinations of "runas" command line parameters but it does not work.
    Administrator is the name of a specific account, a built-in one that is normally disabled.
    So you are trying to tell your script to run using a disabled user.
    Run your command again using the name of another Admin account, one that you have created, that is currently enabled.

    All the best,
    Denis
      My Computer


 

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

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




Windows 10 Forums