@echo off color 1E REM ############################################################################ REM # REM # Setup_Backup_User.cmd created by Mark Wolfgruber REM # REM # Source: 600infos.de REM # Vers. 2017-12-22a REM # REM ############################################################################ :vars set "_Username=Backup" set "_RegPath=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" set "_RegWord=1" set "_Key=1" :start cls echo. echo.Blendet den USER: %_Username% im Anmeldebildschirm aus/ein echo.Script muss mit Administratorrechten gestartet werden REM # REG_DWORD 0x0 = Ausgeblendet REM # REG_DWORD 0x1 = Eingeblendet REM # REM # echo.--- net user REM # echo.--- echo.------------------------------------------------------------------------------- net user "%_Username%" | findstr "aktiv Benutzername" set "_RegKey=%_Username%" REG QUERY "%_RegPath%" /v %_RegKey% echo.------------------------------------------------------------------------------- echo.AUSWAHL User "%_Username%" echo. echo. 0 = User Ausblenden ! 1 = User Einblenden echo. n = User neu anlegen ! e = User entfernen echo. a = User aktivieren ! d = User deaktiviren echo. w = Usernamen wechseln ! p = Passwort setzen echo. ! b = Beenden (EXIT) echo. set /p "_Key=Ihre Wahl: " if /I "%_Key%"=="0" call :choice_0 if /I "%_Key%"=="0" goto :start if /I "%_Key%"=="1" call :choice_1 if /I "%_Key%"=="1" goto :start if /I "%_Key%"=="n" call :choice_n if /I "%_Key%"=="n" goto :start if /I "%_Key%"=="e" call :choice_e if /I "%_Key%"=="e" goto :start if /I "%_Key%"=="p" call :choice_p if /I "%_Key%"=="p" goto :start if /I "%_Key%"=="a" call :choice_a if /I "%_Key%"=="a" goto :start if /I "%_Key%"=="d" call :choice_d if /I "%_Key%"=="d" goto :start if /I "%_Key%"=="w" call :choice_w if /I "%_Key%"=="w" goto :start if /I "%_Key%"=="p" call :choice_p if /I "%_Key%"=="p" goto :start if /I "%_Key%"=="b" goto :end echo.ERROR pause goto :start :choice_0 cls echo. echo.User %_Username% wird ausgebledent ... echo. REG ADD "%_RegPath%" /v %_RegKey% /t REG_DWORD /d 0 pause exit /b :choice_1 cls echo. echo.User %_Username% wird eingeblendet ... echo. REG ADD "%_RegPath%" /v %_RegKey% /t REG_DWORD /d 1 pause exit /b :choice_n cls echo. echo.User %_Username% wird neu angelegt ... echo. net user "%_Username%" * /add pause exit /b :choice_e cls echo. echo.User %_Username% wird entfernt ... echo. net user "%_Username%" /delete pause exit /b :choice_a cls echo. net user "%_Username%" | findstr "aktiv Benutzername" echo.User %_Username% wird aktiviert ... echo. net user "%_Username%" /ACTIVE:YES net user "%_Username%" | findstr "aktiv" pause exit /b :choice_d cls echo. net user "%_Username%" | findstr "aktiv Benutzername" echo.User %_Username% wird deaktiviert ... echo. net user "%_Username%" /ACTIVE:NO net user "%_Username%" | findstr "aktiv" pause exit /b :choice_p cls echo. echo.Passwort User %_Username% wird neu gesetzt ... echo. net user "%_Username%" * pause exit /b :choice_w cls echo. REM # echo.--- net user REM # echo.--- echo.Username wird gewechselt ... echo. set /p "_Username=Username: [%_Username%]: " exit /b :end cls echo. exit /b