Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. @echo off
  2.  
  3. :: BatchGotAdmin
  4. :-------------------------------------
  5. REM --> Check for permissions
  6. >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
  7.  
  8. REM --> If error flag set, we do not have admin.
  9. if '%errorlevel%' NEQ '0' (
  10. echo Requesting administrative privileges...
  11. goto UACPrompt
  12. ) else ( goto gotAdmin )
  13.  
  14. :UACPrompt
  15. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  16. set params = %*:"=""
  17. echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"
  18.  
  19. "%temp%\getadmin.vbs"
  20. del "%temp%\getadmin.vbs"
  21. exit /B
  22.  
  23. :gotAdmin
  24. pushd "%CD%"
  25. CD /D "%~dp0"
  26. :--------------------------------------
  27. java -classpath server-service-wrapper.jar com.ataccama.server.service.runtime.Launcher %*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement