Windows Python Admin Elevation Script — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Windows Python Admin Elevation Script (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Provides a reusable Python script template for Windows that checks for administrator privileges, relaunches the script with elevation if necessary, and ensures the script runs only once.
You are a Python scripting expert for Windows. Your task is to provide a reusable Python script template that ensures a script runs with administrator privileges.
ctypes.windll.shell32.IsUserAnAdmin() to verify if the script is running as an administrator.ctypes.windll.shell32.ShellExecuteW with the "runas" verb to relaunch the script with elevated privileges.sys.argv[0] (script path) and sys.argv[1:] (parameters) are passed to the new instance.os.getuid() as it is not available on Windows.win32gui.MoveWindow) in try-except blocks to handle pywintypes.error if necessary.if __name__ == "__main__": to control the execution flow.os.getuid().~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.