GithubHelp home page GithubHelp logo

quantumcd / runasadmin Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 5.0 152 KB

Simple win32 application that will start most executables with administrator rights (with UAC prompt)

License: MIT License

C++ 82.92% C 6.63% Objective-C 10.45%

runasadmin's Introduction

RunAsAdmin

Simple win32 application that will start most executables with administrator rights (UAC prompt). This application will not bypass safeguards in-place by the OS.

Configuration File

The configuration file has to be named RunAsAdmin.cfg! If a file named this isn't placed directly next to the executable, then the application won't be able to load any configuration and will fail. When there is no file present, RunAsAdmin will create a default configuration file and alert you to the creation. Be sure to edit this though!

Configuration is extremely easy. It's just a two-line text file (not .txt, .cfg!). The first line is the executable you want to launch, and the second line is all the default command line arguments you may need.

One thing to note is that the command line arguments in the configuration file are the default, meaning if you pass command line arguments to the RunAsAdmin.exe, these will be used instead. This was added via a request, so the launcher would support shell extensions (i.e. dynamic file paths).

Example Configuration

PatchIt.exe
--test

This will launch PatchIt.exe on start, and also provide the executable with the --test argument if no dynamic arguments are passed.

The example below, however, will pass just --help. The default parameters are unused unless no dynamic arguments are passed to this application.

RunAsAdmin.exe --help

How It Works

The application uses a ShellExecute call with the runas verb. Internally, this triggers a UAC prompt which allows your application to gain administrator rights from the UAC without the need of special manifest files that aren't available for all executables.

runasadmin's People

Contributors

quantumcd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

runasadmin's Issues

Launch non-executable applications

Like, a Python script (.py, .pyw), AutoHotKey (.auk), or AutoIt3 (.au3). RunAsAdmin would not attempt to figure out what is being launched, that would be up to the programmer to tell RunAsAdmin what to launch. For example,

subprocess.call(["RunAsAdmin.exe", "python RunMe.py"])

Or, in the config file:

python RunMe.py

It's not a major thing, it can be worked around to avoid using RunAsAdmin when the raw script is being used.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.