Advertisement
-L0Lock-

Activer ou Désactiver le bureau sécurisé

Sep 15th, 2019
579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.27 KB | None | 0 0
  1. @echo off
  2. chcp 65001
  3. cls
  4.  
  5. echo.
  6.  
  7. :choice
  8. set /P c=Activer ou Désactiver le bureau sécurisé ? Taper A ou D :    
  9. if /I "%c%" EQU "A" goto :activer
  10. if /I "%c%" EQU "D" goto :desactiver
  11. goto :choice
  12.  
  13. :activer
  14. @echo off
  15. REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "PromptOnSecureDesktop" /t REG_DWORD /d 1 /f
  16. REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /t REG_DWORD /d 4 /f
  17. if %errorlevel% neq 0 (goto :echec) else (echo. && echo Basculement au bureau sécurisé ACTIVÉ ! ♥♥♥)
  18. goto :exit
  19.  
  20. :desactiver
  21. @echo off
  22. REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "PromptOnSecureDesktop" /t REG_DWORD /d 0 /f
  23. REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /t REG_DWORD /d 5 /f
  24. if %errorlevel% neq 0 (goto :echec) else (echo. && echo Basculement au bureau sécurisé DÉSACTIVÉ ! ♥♥♥)
  25. goto :exit
  26.  
  27. :echec
  28. echo.
  29. echo On dirait que la commande ne fonctionne pas. Essaye en lançant le fichier en administrateur.
  30. echo.
  31. echo (clic droit sur le fichier → "Exécuter en tant qu'administrateur")
  32. echo.
  33. goto :exit
  34.  
  35. :exit
  36. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement