Advertisement
DOGGYWOOF

Untitled

Nov 26th, 2024 (edited)
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. local function shutdownScreen(reboot)
  2.  
  3. -- Run the Bitlocker set password command
  4. local function runBitlocker()
  5. print("Setting Bitlocker password...")
  6. local result, errorMsg = pcall(function()
  7. shell.run("bitlocker set password")
  8. end)
  9. if not result then
  10. print("Error while running Bitlocker: " .. errorMsg)
  11. end
  12. end
  13.  
  14. -- Run the Bitlocker command
  15. runBitlocker()
  16.  
  17. -- Display message that the machine can be safely turned off
  18. print("You can safely turn off the machine.")
  19.  
  20. -- Perform shutdown or reboot based on the parameter
  21. if reboot then
  22. os.reboot() -- Trigger the reboot
  23. else
  24. os.shutdown() -- Trigger the shutdown
  25. end
  26. end
  27.  
  28. -- Override os shutdown and reboot functions
  29. function os.shutdown()
  30. shutdownScreen(false)
  31. end
  32.  
  33. function os.reboot()
  34. shutdownScreen(true)
  35. end
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement