Project

uac

0.0
No commit activity in last 3 years
No release in over 3 years
Executes commands with elevated privilege in Windows
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 1.9
 Project Readme

This program elevates program privilege under a UAC enabled Windows environment, just like sudo in Linux.

Installation

Examples

  • View netstat and then pause after execution.

    uac netstat -anb
  • Executing multiple commands (including shell directives) and pause after execution.

    uac "cd /d d:\ && dir"

    Because Windows shell intercepts the special operators like &, &&, >, |. It's necessary to quote the entire command. Otherwise uac won't see the && dir part.

  • Starting a service or windows application with admin privilege, but do not open a terminal.

    uacs putty yoursite.com

    It's equivalent to

    uac --no-terminal -- putty yoursite.com

    uacs is the shorthand for

    uac --no-terminal -- <COMMAND>

    --no-terminal option here is to not start a terminal window when executing the given command. -- is used to separate the options passed to uac and the commands to be executed.

  • Starting a terminal with admin privilege.

    uacs cmd

Getting Help

uac -h

Note, by the nature of Windows design, a process cannot be elevated directly, only a new process can be granted the admin privilege. So uac opens a new window or starts a new process every time you call.