Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

net start [service name]

net stop [service name]



Actually I tend to use sc start/stop for that, but .. should be the same.

Important utilities:

- findstr ('grep') - sc (control services) - taskkill (kill/control processes) - netsh (everything network) - wevtutil (windows event log)


I figure there's probably a reason Microsoft uses net for this on their help page.


The difference is in synchronicity. Using SC START on the help page should properly be followed by SC QUERY in order to check that the service started. NET START won't return until the service starts, errors, or times out.

> "SC sends the control to the service and then returns to the command prompt. This typically results in SC START returning the service in a state of START_PENDING. NET START will wait for the service it is starting to come to a fully started state before it returns control at the command prompt."

From http://cbfive.com/command-line-service-management-net-v-sc/


Which does absolutely nothing on Patch Tuesday updates that require a reboot.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: