Batch file is not stopping a windows server

Batch file is not stopping windows service even if I run it as an administrator. I need this service to start and stop on a schedule.

Tried without and without quotes.
NET STOP "Cloud Station Backup VSS Service x64"

I tried from a command prompt as administrator and was able to start and stop it.
cnl83Asked:
Who is Participating?
 
McKnifeCommented:
The batch file needs to be run elevated, that's all. Right click it and select "run as administrator".
2
 
Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
open powershell console and run:
get-service "Cloud Station Backup VSS Service x64" | select Name,DisplayName and post the result

Open in new window



What if you use powershell?
To stop: Stop-Service  "Cloud Station Backup VSS Service x64"
To Start:  Start-Service "Cloud Station Backup VSS Service x64"

On script:
$status = Get-Service "Cloud Station Backup VSS Service x64" | select -ExpandProperty  status
if($Status -eq "Stopped"){ #if stopped start it
    Start-Service "Cloud Station Backup VSS Service x64"
}

if($Status -eq "Running"){ #if Running, stop it
    Stop-Service "Cloud Station Backup VSS Service x64"
}

Open in new window

0
 
cnl83Author Commented:
I can't use powershell because some of these computers will not have powershell.
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
Yes as McKnife says, you have a checkbox in the Task Scheduler that is "Run with the highest privileges" that one needs to be checked.

PS Powershell is there since windows 7. (version 2.0).
0
 
cnl83Author Commented:
Yes, elevated mode worked. Thanks!
0
 
Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
Yes, to stop or start services you need that level of privileges.
0
 
McKnifeCommented:
Anything still unclear? If not, please close the question now.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.