Nessiesson

Davids Maple

Oct 6th, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. @echo off
  2. :: BatchGotAdmin (Run as Admin code starts)
  3. REM --> Check for permissions
  4. >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  5. REM --> If error flag set, we do not have admin.
  6. if '%errorlevel%' NEQ '0' (
  7. echo Requesting administrative privileges...
  8. goto UACPrompt
  9. ) else ( goto gotAdmin )
  10. :UACPrompt
  11. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  12. echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
  13. "%temp%\getadmin.vbs"
  14. exit /B
  15. :gotAdmin
  16. if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
  17. pushd "%CD%"
  18. CD /D "%~dp0"
  19. :: BatchGotAdmin (Run as Admin code ends)
  20. :: Your codes should start from the following line
  21. cd "%ProgramFiles%\Maple 2016\lib"
  22. type NUL > maple.ini
  23. @echo with(Gym):; > maple.ini
Advertisement
Add Comment
Please, Sign In to add comment