From b5b99b72733ca5c064b46fdf4527ace28b8b545b Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Fri, 12 May 2017 17:36:59 -0400 Subject: Add all of the traversal source files Change-Id: Id31f4bdda9c86f782f86829f8b86dada959a9729 Signed-off-by: Venkata Harish K Kajur --- stop-cassandra-service.bat | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 stop-cassandra-service.bat (limited to 'stop-cassandra-service.bat') diff --git a/stop-cassandra-service.bat b/stop-cassandra-service.bat new file mode 100644 index 0000000..32335ba --- /dev/null +++ b/stop-cassandra-service.bat @@ -0,0 +1,33 @@ +@echo off + +:: BatchGotAdmin +:------------------------------------- +REM --> Check for permissions + IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( +>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" +) ELSE ( +>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" +) + +REM --> If error flag set, we do not have admin. +if '%errorlevel%' NEQ '0' ( + echo Requesting administrative privileges... + goto UACPrompt +) else ( goto gotAdmin ) + +:UACPrompt + echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" + set params = %*:"="" + echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" + + "%temp%\getadmin.vbs" + del "%temp%\getadmin.vbs" + exit /B + +:gotAdmin + pushd "%CD%" + CD /D "%~dp0" +:-------------------------------------- +call net stop DataStax_Cassandra_Community_Server +call net stop DataStax_OpsCenter_Agent +call net stop DataStax_OpsCenter_Community \ No newline at end of file -- cgit 1.2.3-korg