summaryrefslogtreecommitdiffstats
path: root/stop-cassandra-service.bat
diff options
context:
space:
mode:
authorVenkata Harish K Kajur <vk250x@att.com>2017-05-12 17:36:59 -0400
committerVenkata Harish K Kajur <vk250x@att.com>2017-05-12 17:37:13 -0400
commitb5b99b72733ca5c064b46fdf4527ace28b8b545b (patch)
treeb1606e7d824e5d56b3530f724bf7bf326f9a7833 /stop-cassandra-service.bat
parentb6a2b26886ac329dd0836270127c1b9d283c3659 (diff)
Add all of the traversal source files
Change-Id: Id31f4bdda9c86f782f86829f8b86dada959a9729 Signed-off-by: Venkata Harish K Kajur <vk250x@att.com>
Diffstat (limited to 'stop-cassandra-service.bat')
-rw-r--r--stop-cassandra-service.bat33
1 files changed, 33 insertions, 0 deletions
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