I am working on a small batch script that elevates basic windows programs to run as administrator.
All of the functions work fine but I have ran into a problem when trying to run "regedit.exe".
When option 3 is selected in the script and it should run regedit as admin I get error:
740: The requested operation requires elevation.
Here is the script:
echo off
cls
echo.
echo Start as admin:
echo /----------------\
echo # 1. CMD #
echo # 2. Task Manager#
echo # 3. Regedit #
echo # 0. Exit #
echo \----------------/
echo.
set /p run=
if %run%==1 (
set run="cmd"
)
if %run%==2 (
set run="taskmgr"
)
if %run%==3 (
set run="regedit"
)
if %run%==0 (
exit
)
runas /savecred /user:admin %run%
Is there a workaround for this?
I would like make this working without installing third party programs, modifying the registry or disabling UAC.