Refactor script to enhance clarity and organization of system policy modifications
This commit is contained in:
@@ -1,21 +1,32 @@
|
||||
@echo off
|
||||
|
||||
REM --- Deshabilitar Lock Workstation para el sistema (todos los usuarios actuales) ---
|
||||
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" ^
|
||||
/v DisableLockWorkstation /t REG_DWORD /d 1 /f
|
||||
REM === DESACTIVAR BLOQUEO DE EQUIPO Y CAMBIO DE USUARIO ===
|
||||
|
||||
REM --- Aplicar a nuevos usuarios (mediante .DEFAULT) ---
|
||||
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableLockWorkstation /t REG_DWORD /d 1 /f
|
||||
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v HideFastUserSwitching /t REG_DWORD /d 1 /f
|
||||
|
||||
REM --- Default User (para nuevos usuarios) ---
|
||||
reg load HKU\DefaultUser "C:\Users\Default\NTUSER.DAT"
|
||||
reg add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Policies\System" ^
|
||||
/v DisableLockWorkstation /t REG_DWORD /d 1 /f
|
||||
reg add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableLockWorkstation /t REG_DWORD /d 1 /f
|
||||
reg add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v HideFastUserSwitching /t REG_DWORD /d 1 /f
|
||||
reg unload HKU\DefaultUser
|
||||
|
||||
REM --- Bloquear "Cambiar de usuario" para todos los usuarios actuales ---
|
||||
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" ^
|
||||
/v HideFastUserSwitching /t REG_DWORD /d 1 /f
|
||||
REM === DESACTIVAR SUSPENSIÓN, HIBERNACIÓN, APAGADO AUTOMÁTICO ===
|
||||
|
||||
REM --- Aplicar también a nuevos usuarios (modificando Default profile) ---
|
||||
reg load HKU\DefaultUser "C:\Users\Default\NTUSER.DAT"
|
||||
reg add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Policies\System" ^
|
||||
/v HideFastUserSwitching /t REG_DWORD /d 1 /f
|
||||
reg unload HKU\DefaultUser
|
||||
REM --- Desactivar hibernación ---
|
||||
powercfg -hibernate off
|
||||
|
||||
REM --- Desactivar suspensión automática (para corriente y batería) ---
|
||||
powercfg -change -standby-timeout-ac 0
|
||||
powercfg -change -standby-timeout-dc 0
|
||||
|
||||
REM --- Desactivar apagado de pantalla ---
|
||||
powercfg -change -monitor-timeout-ac 0
|
||||
powercfg -change -monitor-timeout-dc 0
|
||||
|
||||
REM --- Desactivar suspensión selectiva USB (opcional) ---
|
||||
powercfg -setacvalueindex SCHEME_CURRENT SUB_USB USBSELECTIVE SUSPEND_DISABLE
|
||||
powercfg -setdcvalueindex SCHEME_CURRENT SUB_USB USBSELECTIVE SUSPEND_DISABLE
|
||||
|
||||
REM --- Aplicar cambios al plan activo ---
|
||||
powercfg -setactive SCHEME_CURRENT
|
||||
|
||||
Reference in New Issue
Block a user