mirror of
https://github.com/jazir555/GamesDows.git
synced 2025-06-05 07:07:23 +02:00
Update Enable GamesDows Playnite.bat
This commit is contained in:
parent
cb9218a3d0
commit
88d9e2972a
@ -1,17 +1,27 @@
|
|||||||
@echo off
|
@echo off
|
||||||
SETLOCAL EnableExtensions
|
:: Self-elevating Admin script
|
||||||
@echo off
|
:: This script will automatically request admin rights if not running as admin
|
||||||
echo Checking for administrative privileges
|
|
||||||
net session >nul 2>&1
|
:: Check for admin rights and self-elevate if needed
|
||||||
if %errorlevel% neq 0 (
|
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
|
||||||
echo ====================================================
|
if '%errorlevel%' NEQ '0' (
|
||||||
echo This script must be run with administrative privileges.
|
echo Requesting administrative privileges...
|
||||||
echo Please right-click on the script and select "Run as administrator."
|
goto UACPrompt
|
||||||
echo ====================================================
|
) else (
|
||||||
pause
|
goto GotAdmin
|
||||||
exit /b
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
:UACPrompt
|
||||||
|
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
|
||||||
|
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
|
||||||
|
"%temp%\getadmin.vbs"
|
||||||
|
exit /B
|
||||||
|
|
||||||
|
:GotAdmin
|
||||||
|
if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
|
||||||
|
pushd "%CD%"
|
||||||
|
CD /D "%~dp0"
|
||||||
|
|
||||||
echo Setting Playnite as default shell
|
echo Setting Playnite as default shell
|
||||||
|
|
||||||
echo Set Playnite as the default shell
|
echo Set Playnite as the default shell
|
||||||
|
Loading…
x
Reference in New Issue
Block a user