1

Disclaimer I'm not familiar with these subjects (services, net command, and server maintenance in general).

On Windows, the net command allows to stop and start services, via net stop "<service name>" and net start "<service name>"

Is it bad practice to run net start "<service name>" on a service whose status is not checked beforehand?

I understand that I could check the service status, and start it only if the status is stopped. But if this is not necessary, why complicate things?

I did try to run the command on an already running service, and Powershell simply responded Le service demandé a déjà été démarré. which might translate to The requested service has already been started. I did not see any bad side effects, but I might overlook a lot of issues.

Use case would be to make sure that a specific service is indeed running.

This specific service is supposed to start automatically. The server that hosts it is configured to reboot every day at a specific time (I have no way to control this), and on some occasions, the service does not automatically start. So while we are investigating the starting issue, I want to temporarily fix this by automatically (via the task scheduler) starting the service at a certain time after the reboot if it is not already running.

1
  • [1] from what i can tell, there is no disadvantage to using net start on an already-started service. ///// [2] powershell has a cmdlet to get info about a service. take a look at >>> Get-Help Get-Service -Full <<< for some ideas on how to use it.
    – Lee_Dailey
    Nov 15, 2021 at 13:55

3 Answers 3

1

It's absolutely ok to launch net start ... without checking, yes.

2

I'm not aware of any negative outcomes of attempting to start a service that's already started. Yes, it's fine.

enter image description here

0

Use case would be to make sure that a specific service is indeed running.

If the service is providing a function or purpose, that would be the test. Otherwise, the service needs to report status correctly - which it currently is not.

1
  • I realize my title could be misleading, it is corrected now. The service can report its status just fine. It is only I who don't want to check its status before running the net start command. I wonder if it is a bad practice, or if it is a shortcut that is perfectly fine to take. Nov 15, 2021 at 14:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .