-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.bat
More file actions
17 lines (16 loc) · 684 Bytes
/
run.bat
File metadata and controls
17 lines (16 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@echo off
title Ash's Windows Tweaks Manager
:: Try to run as Administrator.
:: If elevation is not available (e.g. school), falls back to running as current user.
net session >nul 2>&1
if %errorLevel% == 0 (
:: Already admin — run directly
powershell -ExecutionPolicy Bypass -File "%~dp0tweaks.ps1"
) else (
:: Not admin — attempt UAC elevation, fall back silently if denied
powershell -Command "try { Start-Process -FilePath '%~f0' -Verb RunAs -ErrorAction Stop } catch { }" >nul 2>&1
if %errorLevel% neq 0 (
:: Elevation failed or was denied — run as current user anyway
powershell -ExecutionPolicy Bypass -File "%~dp0tweaks.ps1"
)
)