by
363 8
0
3
2,083
0
Top 1% !
Famous
Specified
Popularity: 11636th place

Published on:

No tags for this snippet yet.
LanguageBatchfile
LicenseMIT_X11
OSWindows
SourceGitHub

This file will enable/disable the Windows built-in administrator account. This account is disabled by default, but is sometimes needed in order to have certain permissions. Be sure you run this file as administrator or assign the appropriate permission...

This file will enable/disable the Windows built-in administrator account. This account is disabled by default, but is sometimes needed in order to have certain permissions. Be sure you run this file as administrator or assign the appropriate permissions to execute it.: 
toggleAdministratorAccount.bat
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/514865/This-file-will-enable-disable-the-Window?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
:: This will enable/disable the Windows built-in administrator account. :: Run this file as "Run as administrator", and then at the prompt, enter :: one of the following options: y | n | yes | no ... the /i flag makes the :: options case insensitive, so either capital or lower case is accepted. :: Enter any other value, or no value at all, will return an error message :: and not run the command. ECHO OFF SETLOCAL SET /P doAdmin="Enable Windows built-in administrator account? (y/n) " IF /i "%doAdmin%" EQU "n" SET doAdmin=no IF /i "%doAdmin%" EQU "y" SET doAdmin=yes IF NOT DEFINED doAdmin ( ECHO No action was taken. User input is required. PAUSE EXIT ) ELSE ( IF /i "%doAdmin%" EQU "no" ( SET domainLabel=disabled net user administrator /active:%doAdmin% GOTO runAdmin ) IF /i "%doAdmin%" EQU "yes" ( SET domainLabel=enabled net user administrator /active:%doAdmin% GOTO runAdmin ) ECHO No action was taken. "%doAdmin%" is not a valid option. PAUSE EXIT ) :runAdmin ECHO The built in administrator has been %domainLabel% PAUSE ENDLOCAL EXIT
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus