`run_as_task` is a Python package that allows scripts to escalate their privileges to Administrator (Local Service) without requiring UAC approval.
Project description
run_as_task
run_as_task is a Python package that allows scripts to escalate their privileges to Administrator (Local Service) on Windows, without requiring UAC approval. This project is a port of AHK RunAsTask.
Installation
PS > pip install run_as_task
Usage
Here is a basic example of how to use run_as_task
to run the Windows Registry Editor (regedit
) with escalated privileges:
# regedit.py
from run_as_task import run_as_task
import subprocess
run_as_task()
subprocess.Popen(['regedit'], creationflags=subprocess.CREATE_NO_WINDOW)
Important Notes
-
First Run Setup: When you run the script for the first time,
run_as_task
will register the script as a Windows Scheduled Task to allow for escalated execution. This initial setup will prompt you for UAC (User Account Control) permissions. -
Subsequent Runs: After the initial setup, running the script again will not prompt for UAC. Instead, it will trigger the scheduled task to run with escalated privileges.
To execute the script, use the following command in PowerShell:
PS > pythonw regedit.py
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For any questions or support, please reach out to me via GitHub Issues.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for run_as_task-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | daa1a755b4b943d81c5339acd4ef659919e4dd82fa551e1ca745e18e82a2c66c |
|
MD5 | 5d332cb7d9b48fc5907f99d34cd2c981 |
|
BLAKE2b-256 | 9c9c7e17cdbc279f5b54a9f2572ca4b3c62e856fc427bfff3f468a96dce3f243 |