Advertisement
Guest User

LogOffInstructable

a guest
Feb 18th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. @echo OFF
  2. goto getPrivileges
  3.  
  4. :getPrivileges
  5. if '%1'=='ELEV' (shift & goto gotPrivileges)
  6. echo ***************************
  7. echo GETTING PERMISSIONS FOR SHUTDOWN, ETC. . .
  8. echo ***************************
  9. setlocal DisableDelayedExpansion
  10. set "batchPath=%~0"
  11. setlocal EnableDelayedExpansion
  12. ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
  13. ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
  14. "%temp%\OEgetPrivileges.vbs"
  15. goto Stuff
  16.  
  17. :Stuff
  18. echo Information:
  19. echo ---------------------------------------------
  20. echo Logoff: Just logoff the account, You have to log back in.
  21. echo Reboot: Close all remaining tabs, technically refresh the computer.
  22. echo Hibernate: Keep all tabs, just turns off the computer. (so it keeps like a game on.)
  23. echo Shutdown: Close all remaining tabs, technically refresh the computer. (same thing with reboot)
  24. echo Exit: Just leave this Turn Off file.
  25. echo ---------------------------------------------
  26. pause
  27. echo ---------------------------------------------
  28. ECHO "Choose an option .."
  29. ECHO "1 = Logoff"
  30. ECHO "2 = Reboot"
  31. ECHO "3 = Hibernate"
  32. ECHO "4 = Shutdown"
  33. ECHO "5 = Exit"
  34. echo ---------------------------------------------
  35. SET /p option=Option:
  36.  
  37. IF %option%==1 SHUTDOWN /l
  38. IF %option%==2 SHUTDOWN -r -t 10
  39. IF %option%==3 SHUTDOWN /h
  40. IF %option%==4 SHUTDOWN /s /f /t 0
  41. IF %option%==5 exit
  42.  
  43. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement