Link to home
Start Free TrialLog in
Avatar of cnl83
cnl83Flag for United States of America

asked on

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.
Avatar of J0rtIT
J0rtIT
Flag of Venezuela, Bolivarian Republic of image

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

Avatar of cnl83

ASKER

I can't use powershell because some of these computers will not have powershell.
ASKER CERTIFIED SOLUTION
Avatar of McKnife
McKnife
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cnl83

ASKER

Yes, elevated mode worked. Thanks!
Yes, to stop or start services you need that level of privileges.
Anything still unclear? If not, please close the question now.