Created
July 1, 2022 04:28
-
-
Save maciakl/7da540c8b11ee65f4e87925dd03304b2 to your computer and use it in GitHub Desktop.
Interactive helper script to activate Admin account and change it's password
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if "%1" == "elevated" goto start | |
powershell -command "Start-Process %~nx0 elevated -Verb runas" | |
goto :eof | |
:start | |
@echo off | |
cls | |
CALL :HEAD | |
CALL :ADMININFO | |
echo. | |
choice /M "[A]ctivate, [C]hange Password, or [Q]uit" /C ACQ | |
echo. | |
if %ERRORLEVEL% == 1 ( CALL :ACTIVATE ) | |
if %ERRORLEVEL% == 2 ( CALL :CHANGEPW ) | |
if %ERRORLEVEL% == 3 ( goto :eof ) | |
goto :start | |
:HEAD | |
cls | |
echo. | |
echo Admin Helper | |
echo ============ | |
echo. | |
goto :eof | |
:ADMININFO | |
echo. | |
net user Administrator | findstr name | |
net user Administrator | findstr active | |
net user Administrator | findstr last | |
echo. | |
goto :eof | |
:CHANGEPW | |
set /P pw=Entern rew password, then press ENTER: | |
net user Administrator %PW% | |
pause | |
goto :eof | |
:ACTIVATE | |
net user Administrator /active:yes | |
pause | |
goto :eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment