BookmarkSubscribeRSS Feed

Start/Stop all SAS Services in Windows using Batch File

Started ‎12-18-2019 by
Modified ‎12-20-2019 by
Views 5,763

In Linux or Z/OS we can use sas.servers script in LevX directory to operate all SAS Servers from just one command (./sas.servers start/stop).

But for windows, we don’t have any script like that which can start or stop all the SAS Services using Batch file.


To make the operating SAS Services effortless for Windows Admins, I have created two batch files to start and stop all SAS Services with other SAS services dependencies.


These scripts will start/stop SAS Services in correct order, and these scripts can be customized easily for environment- specific needs by anyone who has a little Windows Batch Scripting knowledge.


Please view the GIF below to see how these scripts work.


Preview of starting SAS Services using "Start SAS Services.bat" file:




Preview of stopping SAS Services using "Stop SAS Services.bat" file:




You can download both scripts from the attachment.


Thanks for sharing this. I remember you had posted this earlier as a post in the admin community. It's really helpful to automate start/stop of services in win platform.

@Anand_V You're Welcome, and yes, I've posted this content before as a question but it was not well organized in context of Knowledge Base Article, for that reason only I've posted this article,

Also, one more good thing about posting this as an Article is that anyone else who've updated this code or have a better version of this, they can also update this content by Community Manager's Approval.

@Kalind_Patel  - Thanks for posting. I'm hopeful that the sas.servers script will eventually be enhanced to include Windows. I appears to be one of  the improvements being considered.

@SASKiwi I'm hoping for the same, sas.servers script makes the SAS Service operations very easy and non-interactive in many cases.

Thanks alot,



Very Helpful content...Thanks... 

why it is not possible to restart the LSF services in the same way , even though LSF and SAS services share the logon as startup.

Version history
Last update:
‎12-20-2019 11:55 AM
Updated by:



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags