Commands & Syntax > Commands > Macro Flow Control >

IF WINDOWS SERVICE - < if_winsvc >() ... [Pro]

www.perfectkeyboard.com

 

IF WINDOWS SERVICE
<if_winsvc>("Service Name","Condition")
Available in: Professional edition

The command evaluates a Windows service state and if it is evaluated as "true" then following macro steps (steps between "if" and "else/endif") are executed.

 

#

Parameter name

Parameter description

1

Service Name

The Windows service name

2

Condition

Windows service state:
"Running" - the service is running
"Not running" - the service is installed but it is not running.
"Installed" - the service is installed, it does not matter if it is running or not.
"Not Installed" - the service is not installed.

 

Example (Macro Steps):

 

1

<#> <#>This macro shows how to use "if_winsvc" and "winsvc" commands

2

Macro execution: ONLY COMMANDS

3

IF WINDOWS SERVICE "WebClient" is "NOT running" then execute following steps

4

WINDOWS SERVICE "WebClient", Command="Start"

5

ENDIF

Example (Plain Text):

 

<#>This macro shows how to use "if_winsvc" and "winsvc" commands

<cmds>

<if_winsvc>("WebClient","IS_NOT_RUNNING")

   <winsvc>("WebClient","START")

<endif>