Skip to content

The script checks if it has administrative privileges; if not, it re-runs itself with elevated privileges. Once it has admin rights, it deletes the registry values responsible for displaying legal notices at system startup.

License

Notifications You must be signed in to change notification settings

edirimkus/Admin-Privilege-Registry-Editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Admin Privilege Registry Editor

Overview

This batch script checks for administrative privileges and re-runs itself with elevated rights if necessary. Once it has administrative privileges, it deletes specific registry values related to legal notices shown at system startup.

Script Breakdown

  1. Start and Parameters: Sets the parameters for the script execution.

    :start
    set "params=%*"
  2. Change Directory to Script Location: Changes the working directory to the script's location.

    cd /d "%~dp0" && (
  3. Check and Create a VBScript for Elevation: Checks for administrative privileges and creates a VBScript to elevate if necessary.

    if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs"
    fsutil dirty query %systemdrive% 1>nul 2>nul || (
    echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
    "%temp%\getadmin.vbs"
    exit /B
    )
    
  4. Delete Registry Keys: Deletes the registry keys for legalnoticecaption and legalnoticetext.

    REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v legalnoticecaption /f
    REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v legalnoticetext /f
  5. Exit: Exits the script.

    exit

Usage

  1. Run the Script: Execute the script in an elevated Command Prompt session.
    .\admin-privilege-registry-editor.bat

License

This script is licensed under the MIT License. See the LICENSE file for details.

About

The script checks if it has administrative privileges; if not, it re-runs itself with elevated privileges. Once it has admin rights, it deletes the registry values responsible for displaying legal notices at system startup.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published