Tech Off Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

UAC and CMD, Is there anything close to a su/sudo command?

Back to Forum: Tech Off
  • User profile image
    AnXa

    Hi,

    I haven't written anything in a while but there's this small thing bugging me right now and I cannot seem to find good answer using Google and browsing MSDN.

    In UNIX family or alike OSes there's a command for lifting access rights for user which is called "su", like most of you probably know. There's also a command for running software with lifted privileges called "sudo".

    I am pretty sure that UAC developers were not so stupid that they didn't include any CLI way to initiate UAC so that user can run software from command line with lifted rights.

    So is there anything close to a su/sudo commands in Windows command line?

    Thanks!

     

    PS. Let me add that the point here isn't starting cmd.exe from start menu with "run as administrator" (after which you're running everything with lifted rights) but to run normal level cmd.exe and do something like "launch /uac application.exe" or "sudo application.exe". After that it will show secure desktop and asks for confirmation or asks the confirmation on command line itself.

    I am asking this just out of curiosity because it would be great to have some way of running applications with lifted rights using keyboard only (I do know about ctrl+shift+return will launch cmd.exe in start menu with lifted privileges) for commands which will require administrative rights without running cmd.exe with lifted rights all the time.

  • User profile image
    evildictait​or

    Check out sudo for Windows at SourceForge or http://code.kliu.org/misc/elevate/">http://code.kliu.org/misc/elevate/

    Another easy thing to do (on Win7) is if you pin CMD.exe to the taskbar and then left click it, you get a low integrity cmd.exe. If you CTRL+SHIFT click it, it'll try and elevate and give you an Admin CMD.exe.

     

  • User profile image
    W3bbo

    runas.exe?

  • User profile image
    AnXa

    This "Elevate" program is pretty much what I was looking for. Thank you so much!

     

    PS. runas.exe, as it seems to me, doesn't run things with elevated rights. Only as a different user with normal rights. If I do "runas /user:Administrator someapplication.exe" it runs it using Administrator account on normal user rights (after asking password).

  • User profile image
    MrError

    If PowerShell is avalable you can use following comand:

    powershell start-process -Verb "runas" cmd


    Have fun

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.