Skip to main content

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

  1. 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.

  2. 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.

Metadata

Release files for run_as_task 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for run_as_task 0.1.4
File Size Uploaded
run_as_task-0.1.4.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for run_as_task 0.1.4
File Interpreter ABI Platform
run_as_task-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.8 kB

Release files / run_as_task-0.1.4.tar.gz

Download URL run_as_task-0.1.4.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bf8e040a6e3b44591dd772bc9101904556ca59ac115e0548a095e2305fa4cb33
BLAKE2b-256 checksum
How to use checksums
f8d034605e5ac072b12c808dc48720c75fb8177937aa1983be8ef2a6bd7f9b59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure

Release files / run_as_task-0.1.4-py3-none-any.whl

Download URL run_as_task-0.1.4-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee08fa49ca8f23d8aca19116ef9def028125ed4a738929e991f5ce895f3dd487
BLAKE2b-256 checksum
How to use checksums
25d5e44f7fa94cbb217c80fdbb3c9850c4b72cff2a663b28a3f78c6b11cee0d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.6 Linux/6.8.0-1014-azure

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page