Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo OFF
- goto getPrivileges
- :getPrivileges
- if '%1'=='ELEV' (shift & goto gotPrivileges)
- echo ***************************
- echo GETTING PERMISSIONS FOR SHUTDOWN, ETC. . .
- echo ***************************
- setlocal DisableDelayedExpansion
- set "batchPath=%~0"
- setlocal EnableDelayedExpansion
- ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
- ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
- "%temp%\OEgetPrivileges.vbs"
- goto Stuff
- :Stuff
- echo Information:
- echo ---------------------------------------------
- echo Logoff: Just logoff the account, You have to log back in.
- echo Reboot: Close all remaining tabs, technically refresh the computer.
- echo Hibernate: Keep all tabs, just turns off the computer. (so it keeps like a game on.)
- echo Shutdown: Close all remaining tabs, technically refresh the computer. (same thing with reboot)
- echo Exit: Just leave this Turn Off file.
- echo ---------------------------------------------
- pause
- echo ---------------------------------------------
- ECHO "Choose an option .."
- ECHO "1 = Logoff"
- ECHO "2 = Reboot"
- ECHO "3 = Hibernate"
- ECHO "4 = Shutdown"
- ECHO "5 = Exit"
- echo ---------------------------------------------
- SET /p option=Option:
- IF %option%==1 SHUTDOWN /l
- IF %option%==2 SHUTDOWN -r -t 10
- IF %option%==3 SHUTDOWN /h
- IF %option%==4 SHUTDOWN /s /f /t 0
- IF %option%==5 exit
- pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement