Skip to content
⌘ NSIS Forum Archive

Working with services

3 posts

oldfriend#

Working with services

Simple question.

So what is the best current way to work with services which supports Unicode and windows 7,8,10?

Page http://nsis.sourceforge.net/How_do_I...heck_a_service seems is very old.
oldfriend#
Sad to spend days to find answers which already somewhere were described.

For me the following code works to start/stop service

StrCpy $1 "${SERVICE_NAME}" ;service name
ExpandEnvStrings $0 "%comspec%"
nsExec::ExecToStack '"$0" /k "net stop "$1""'
Pop $0
Pop $1
StrCpy $1 $1 1
${If} "$0$1" == "01"
; MessageBox mb_ok "Running"
${Else}
; MessageBox mb_ok "Not Running"
${EndIf}
T.Slappy#
It is nice you posted the solution (not tested by me!) which helps spread the NSIS knowledge. Thanks!