Refactor script to enhance clarity and organization of system policy modifications
This commit is contained in:
@@ -1,21 +1,32 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
REM --- Deshabilitar Lock Workstation para el sistema (todos los usuarios actuales) ---
|
REM === DESACTIVAR BLOQUEO DE EQUIPO Y CAMBIO DE USUARIO ===
|
||||||
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" ^
|
|
||||||
/v DisableLockWorkstation /t REG_DWORD /d 1 /f
|
|
||||||
|
|
||||||
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 load HKU\DefaultUser "C:\Users\Default\NTUSER.DAT"
|
||||||
reg add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Policies\System" ^
|
reg add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisableLockWorkstation /t REG_DWORD /d 1 /f
|
||||||
/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
|
reg unload HKU\DefaultUser
|
||||||
|
|
||||||
REM --- Bloquear "Cambiar de usuario" para todos los usuarios actuales ---
|
REM === DESACTIVAR SUSPENSIÓN, HIBERNACIÓN, APAGADO AUTOMÁTICO ===
|
||||||
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" ^
|
|
||||||
/v HideFastUserSwitching /t REG_DWORD /d 1 /f
|
|
||||||
|
|
||||||
REM --- Aplicar también a nuevos usuarios (modificando Default profile) ---
|
REM --- Desactivar hibernación ---
|
||||||
reg load HKU\DefaultUser "C:\Users\Default\NTUSER.DAT"
|
powercfg -hibernate off
|
||||||
reg add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Policies\System" ^
|
|
||||||
/v HideFastUserSwitching /t REG_DWORD /d 1 /f
|
REM --- Desactivar suspensión automática (para corriente y batería) ---
|
||||||
reg unload HKU\DefaultUser
|
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