none
Batch File RRS feed

  • Question

  • Hi All,

    how to make bat file with administrator username & password to run in limited user access.

    Thanks In Advance

    Tuesday, March 11, 2014 1:59 PM

Answers

  • i had already done this but i am still not able to run in Non administrator rights.

    can u guide me how to run with Non administrator user.

    Or 

    Any other cmd apart from Net use?

    There are similar commands in VBScript and PowerShell. All of them are subject to the same restrictions. Scripts will never let you get around security restrictions. If you could use a script to defy restriction then what would be the point of having restrictions?
    Tuesday, March 11, 2014 2:26 PM

All replies

  • how to make bat file with administrator username & password to run in limited user access.

    Open a Command Prompt with cmd.exe, then type these two commands to see how it's done:

    net user /?
    net help user

    Tuesday, March 11, 2014 2:05 PM
  • i had already done this but i am still not able to run in Non administrator rights.

    can u guide me how to run with Non administrator user.

    Or 

    Any other cmd apart from Net use?

    • Edited by Shailu88 Tuesday, March 11, 2014 2:14 PM
    Tuesday, March 11, 2014 2:08 PM
  • i had already done this but i am still not able to run in Non administrator rights.

    can u guide me how to run with Non administrator user.

    Or 

    Any other cmd apart from Net use?

    There are similar commands in VBScript and PowerShell. All of them are subject to the same restrictions. Scripts will never let you get around security restrictions. If you could use a script to defy restriction then what would be the point of having restrictions?
    Tuesday, March 11, 2014 2:26 PM
  • Sorry but you cannot do that.  It is unsafe and ther is no utility to accomplish a batch file elevating itself.

    A user can store admin credentials to use with RunAs but they would also know the credentials.

    Here is a test you can run to prove that all saved encrypted credentials are visible and not really encrypted.

    On WIndows 8 paste these two lines into PowerShell.

    [void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
    (new-object Windows.Security.Credentials.PasswordVault).RetrieveAll() |
         %{ $_.RetrievePassword();$_}
    

    !! - every stored password in your session will become visible. This can be done on any verison of Windows with API calls.  THis is just a newer Net method available in WIndows 8 and later.

    Never - never give out admin passords.


    ¯\_(ツ)_/¯

    Tuesday, March 11, 2014 2:47 PM