<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nsis.sourceforge.io/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Doug</id>
	<title>NSIS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://nsis.sourceforge.io/mediawiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Doug"/>
	<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/Special:Contributions/Doug"/>
	<updated>2026-04-21T22:40:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=WMI_header&amp;diff=18966</id>
		<title>WMI header</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=WMI_header&amp;diff=18966"/>
		<updated>2010-10-07T20:34:40Z</updated>

		<summary type="html">&lt;p&gt;Doug: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
This header includes macros to get WMI information, kill processes on 32 and 64 bit OS systems, and set process priority through the WMIC command line.&lt;br /&gt;
&lt;br /&gt;
The results for getting information are returned to variables within a callback function to allow you to read through multiple results.&lt;br /&gt;
&lt;br /&gt;
There is a huge amount of information that can be retrieved using WMI so I would suggest downloading the [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&amp;amp;displaylang=en WMI Code Creator] as a reference rather than listing them here.&lt;br /&gt;
Most of the useful information uses &amp;quot;root\CIMV2&amp;quot; as the namespace.&lt;br /&gt;
&lt;br /&gt;
This includes [http://nsis.sourceforge.net/Explode cryonyx&#039;s] Explode macro.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
${WMIGetInfo} Namespace Classes Property callbackfunction&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the following information to a function:&lt;br /&gt;
: $R0 = current result number&lt;br /&gt;
: $R1 = total number of results found&lt;br /&gt;
: $R2 = requested information&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
${WMIKillProcess} name.exe&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the following information to the stack:&lt;br /&gt;
: 1 = if the process found and killed&lt;br /&gt;
: 0 = if the process was not found&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
${WMISetPriority} name.exe priority&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Priority can be&lt;br /&gt;
: Low&lt;br /&gt;
: BelowNormal&lt;br /&gt;
: Normal&lt;br /&gt;
: AboveNormal&lt;br /&gt;
: High&lt;br /&gt;
: Realtime&lt;br /&gt;
&lt;br /&gt;
Returns the following information to the stack:&lt;br /&gt;
: 1 = if the process priority was changed&lt;br /&gt;
: 0 = if the process was not found&lt;br /&gt;
&lt;br /&gt;
== Header file - Save this as WMI.nsh ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
!ifndef __WMI_Included__&lt;br /&gt;
!define __WMI_Included__&lt;br /&gt;
!include LogicLib.nsh&lt;br /&gt;
!include &amp;quot;TextFunc.nsh&amp;quot;&lt;br /&gt;
!define Explode_WMI &amp;quot;!insertmacro Explode_WMI&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!define WMIGetInfo &amp;quot;!Insertmacro WMIGetInfo&amp;quot;&lt;br /&gt;
!define WMIKillProcess &amp;quot;!Insertmacro WMIKillProcess&amp;quot;&lt;br /&gt;
!define WMISetPriority &amp;quot;!Insertmacro WMISetPriority&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!macro  Explode_WMI Length  Separator   String&lt;br /&gt;
    Push    `${Separator}`&lt;br /&gt;
    Push    `${String}`&lt;br /&gt;
    Call    Explode_WMI&lt;br /&gt;
    Pop     `${Length}`&lt;br /&gt;
!macroend&lt;br /&gt;
 &lt;br /&gt;
Function Explode_WMI&lt;br /&gt;
  ; Initialize variables&lt;br /&gt;
  Var /GLOBAL explString&lt;br /&gt;
  Var /GLOBAL explSeparator&lt;br /&gt;
  Var /GLOBAL explStrLen&lt;br /&gt;
  Var /GLOBAL explSepLen&lt;br /&gt;
  Var /GLOBAL explOffset&lt;br /&gt;
  Var /GLOBAL explTmp&lt;br /&gt;
  Var /GLOBAL explTmp2&lt;br /&gt;
  Var /GLOBAL explTmp3&lt;br /&gt;
  Var /GLOBAL explArrCount&lt;br /&gt;
 &lt;br /&gt;
  ; Get input from user&lt;br /&gt;
  Pop $explString&lt;br /&gt;
  Pop $explSeparator&lt;br /&gt;
 &lt;br /&gt;
  ; Calculates initial values&lt;br /&gt;
  StrLen $explStrLen $explString&lt;br /&gt;
  StrLen $explSepLen $explSeparator&lt;br /&gt;
  StrCpy $explArrCount 1&lt;br /&gt;
 &lt;br /&gt;
  ${If}   $explStrLen &amp;lt;= 1          ;   If we got a single character&lt;br /&gt;
  ${OrIf} $explSepLen &amp;gt; $explStrLen ;   or separator is larger than the string,&lt;br /&gt;
    Push    $explString             ;   then we return initial string with no change&lt;br /&gt;
    Push    1                       ;   and set array&#039;s length to 1&lt;br /&gt;
    Return&lt;br /&gt;
  ${EndIf}&lt;br /&gt;
 &lt;br /&gt;
  ; Set offset to the last symbol of the string&lt;br /&gt;
  StrCpy $explOffset $explStrLen&lt;br /&gt;
  IntOp  $explOffset $explOffset - 1&lt;br /&gt;
 &lt;br /&gt;
  ; Clear temp string to exclude the possibility of appearance of occasional data&lt;br /&gt;
  StrCpy $explTmp   &amp;quot;&amp;quot;&lt;br /&gt;
  StrCpy $explTmp2  &amp;quot;&amp;quot;&lt;br /&gt;
  StrCpy $explTmp3  &amp;quot;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
  ; Loop until the offset becomes negative&lt;br /&gt;
  ${Do}&lt;br /&gt;
    ;   If offset becomes negative, it is time to leave the function&lt;br /&gt;
    ${IfThen} $explOffset == -1 ${|} ${ExitDo} ${|}&lt;br /&gt;
 &lt;br /&gt;
    ;   Remove everything before and after the searched part (&amp;quot;TempStr&amp;quot;)&lt;br /&gt;
    StrCpy $explTmp $explString $explSepLen $explOffset&lt;br /&gt;
 &lt;br /&gt;
    ${If} $explTmp == $explSeparator&lt;br /&gt;
        ;   Calculating offset to start copy from&lt;br /&gt;
        IntOp   $explTmp2 $explOffset + $explSepLen ;   Offset equals to the current offset plus length of separator&lt;br /&gt;
        StrCpy  $explTmp3 $explString &amp;quot;&amp;quot; $explTmp2&lt;br /&gt;
 &lt;br /&gt;
        Push    $explTmp3                           ;   Throwing array item to the stack&lt;br /&gt;
        IntOp   $explArrCount $explArrCount + 1     ;   Increasing array&#039;s counter&lt;br /&gt;
 &lt;br /&gt;
        StrCpy  $explString $explString $explOffset 0   ;   Cutting all characters beginning with the separator entry&lt;br /&gt;
        StrLen  $explStrLen $explString&lt;br /&gt;
    ${EndIf}&lt;br /&gt;
 &lt;br /&gt;
    ${If} $explOffset = 0                       ;   If the beginning of the line met and there is no separator,&lt;br /&gt;
                                                ;   copying the rest of the string&lt;br /&gt;
        ${If} $explSeparator == &amp;quot;&amp;quot;              ;   Fix for the empty separator&lt;br /&gt;
            IntOp   $explArrCount   $explArrCount - 1&lt;br /&gt;
        ${Else}&lt;br /&gt;
            Push    $explString&lt;br /&gt;
        ${EndIf}&lt;br /&gt;
    ${EndIf}&lt;br /&gt;
 &lt;br /&gt;
    IntOp   $explOffset $explOffset - 1&lt;br /&gt;
  ${Loop}&lt;br /&gt;
 &lt;br /&gt;
  Push $explArrCount&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&lt;br /&gt;
!macro WMIGetInfo _NameSpace _Class _Property _CallBackFunction&lt;br /&gt;
#Push registers to stack&lt;br /&gt;
Push $0&lt;br /&gt;
Push $1&lt;br /&gt;
Push $2&lt;br /&gt;
Push $R0&lt;br /&gt;
Push $R1&lt;br /&gt;
Push $R2&lt;br /&gt;
&lt;br /&gt;
#Execute WMI command to stack&lt;br /&gt;
nsexec::exectostack &amp;quot;wmic /NAMESPACE:\\${_NameSpace} path ${_Class} get ${_Property}&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $1&lt;br /&gt;
&lt;br /&gt;
#Trim blank lines&lt;br /&gt;
${TrimNewLines} &amp;quot;$1&amp;quot; $1&lt;br /&gt;
&lt;br /&gt;
#Explode each result to a stack&lt;br /&gt;
${Explode_WMI}  $R1  &amp;quot;$\n&amp;quot; &amp;quot;$1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#The first line is the same as ${_Property} so we remove it from the stack and subtract it from the results&lt;br /&gt;
Pop $2&lt;br /&gt;
IntOp $R1 $R1 - 1&lt;br /&gt;
&lt;br /&gt;
#Loop through results and do stuff here&lt;br /&gt;
${For} $1 1 $R1&lt;br /&gt;
	Pop $2&lt;br /&gt;
	StrCpy $R0 $1&lt;br /&gt;
	StrCpy $R2 $2&lt;br /&gt;
	Call ${_CallBackFunction}&lt;br /&gt;
${Next}&lt;br /&gt;
&lt;br /&gt;
Pop $R2&lt;br /&gt;
Pop $R1&lt;br /&gt;
Pop $R0&lt;br /&gt;
Pop $2&lt;br /&gt;
Pop $1&lt;br /&gt;
Pop $0&lt;br /&gt;
!macroend&lt;br /&gt;
&lt;br /&gt;
!macro WMIKillProcess _ProcName&lt;br /&gt;
Push $0&lt;br /&gt;
Push $1&lt;br /&gt;
nsexec::exectostack &amp;quot;wmic process where name=&#039;${_ProcName}&#039; delete&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
StrCpy $0 $0 2&lt;br /&gt;
${If} $0 == &amp;quot;No&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 0&lt;br /&gt;
${Else}&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 1&lt;br /&gt;
${EndIf}&lt;br /&gt;
!macroend&lt;br /&gt;
&lt;br /&gt;
!macro WMISetPriority _ProcName _Priority&lt;br /&gt;
push $0&lt;br /&gt;
&lt;br /&gt;
StrCpy $0 &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
${If} ${_Priority} == Low&lt;br /&gt;
StrCpy $0 64&lt;br /&gt;
${ElseIf} ${_Priority} == BelowNormal&lt;br /&gt;
StrCpy $0 16384&lt;br /&gt;
${ElseIf} ${_Priority} == Normal&lt;br /&gt;
StrCpy $0 32&lt;br /&gt;
${ElseIf} ${_Priority} == AboveNormal&lt;br /&gt;
StrCpy $0 32768&lt;br /&gt;
${ElseIf} ${_Priority} == High&lt;br /&gt;
StrCpy $0 128&lt;br /&gt;
${ElseIf} ${_Priority} == RealTime&lt;br /&gt;
StrCpy $0 16384&lt;br /&gt;
${EndIf}&lt;br /&gt;
&lt;br /&gt;
${If} $0 != &#039;&#039;&lt;br /&gt;
nsexec::exectostack &amp;quot;wmic process where name=&#039;${_ProcName}&#039; call setpriority $0&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
StrCpy $0 $0 2&lt;br /&gt;
${If} $0 == &amp;quot;No&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 0&lt;br /&gt;
${Else}&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 1&lt;br /&gt;
${EndIf}&lt;br /&gt;
${EndIf}&lt;br /&gt;
!macroend&lt;br /&gt;
!endif&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
Name WMI&lt;br /&gt;
OutFile WMI.exe&lt;br /&gt;
RequestExecutionLevel Admin&lt;br /&gt;
!include WMI.nsh&lt;br /&gt;
!include LogicLib.nsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section &amp;quot;test&amp;quot;&lt;br /&gt;
#List disk drive models:&lt;br /&gt;
${WMIGetInfo} root\CIMV2 Win32_DiskDrive model callback_Function&lt;br /&gt;
&lt;br /&gt;
#List network adapters:&lt;br /&gt;
${WMIGetInfo} root\CIMV2 Win32_NetworkAdapter name callback_Function&lt;br /&gt;
&lt;br /&gt;
#List user accounts on local computer:&lt;br /&gt;
${WMIGetInfo} root\CIMV2 Win32_UserAccount name callback_Function&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Messagebox MB_YESNO &amp;quot;Launch calc.exe&amp;quot; IDNO +3&lt;br /&gt;
sleep 500&lt;br /&gt;
exec &amp;quot;calc.exe&amp;quot;&lt;br /&gt;
${WMIKillProcess} calc.exe &lt;br /&gt;
pop $0&lt;br /&gt;
&lt;br /&gt;
${If} $0 == 0&lt;br /&gt;
detailprint &amp;quot;calc.exe not found&amp;quot;&lt;br /&gt;
${ElseIf} $0 == 1&lt;br /&gt;
detailprint &amp;quot;calc.exe was found and killed&amp;quot;&lt;br /&gt;
${EndIf}&lt;br /&gt;
&lt;br /&gt;
Messagebox MB_YESNO &amp;quot;Launch calc.exe&amp;quot; IDNO +3&lt;br /&gt;
sleep 500&lt;br /&gt;
exec &amp;quot;calc.exe&amp;quot;&lt;br /&gt;
${WMISetPriority} calc.exe High&lt;br /&gt;
pop $0&lt;br /&gt;
&lt;br /&gt;
${If} $0 == 0&lt;br /&gt;
detailprint &amp;quot;calc.exe not found&amp;quot;&lt;br /&gt;
${ElseIf} $0 == 1&lt;br /&gt;
detailprint &amp;quot;calc.exe was found set to high priority&amp;quot;&lt;br /&gt;
${EndIf}&lt;br /&gt;
&lt;br /&gt;
SectionEnd&lt;br /&gt;
&lt;br /&gt;
Function callback_Function&lt;br /&gt;
detailprint &amp;quot;$R0/$R1=$R2&amp;quot;&lt;br /&gt;
FunctionEnd&lt;/div&gt;</summary>
		<author><name>Doug</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=WMI_header&amp;diff=18945</id>
		<title>WMI header</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=WMI_header&amp;diff=18945"/>
		<updated>2010-09-28T18:25:53Z</updated>

		<summary type="html">&lt;p&gt;Doug: /* Header file - Save this as WMI.nsh */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
This header includes macros to get WMI information, kill processes on 32 and 64 bit OS systems, and set process priority through the WMIC command line.&lt;br /&gt;
&lt;br /&gt;
The results for getting information are returned to variables within a callback function to allow you to read through multiple results.&lt;br /&gt;
&lt;br /&gt;
There is a huge amount of information that can be retrieved using WMI so I would suggest downloading the [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&amp;amp;displaylang=en WMI Code Creator] as a reference rather than listing them here.&lt;br /&gt;
Most of the useful information uses &amp;quot;root\CIMV2&amp;quot; as the namespace.&lt;br /&gt;
&lt;br /&gt;
This includes [http://nsis.sourceforge.net/Explode cryonyx&#039;s] Explode macro.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
${WMIGetInfo} Namespace Classes Property callbackfunction&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the following information to a function:&lt;br /&gt;
: $R0 = current result number&lt;br /&gt;
: $R1 = total number of results found&lt;br /&gt;
: $R2 = requested information&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
${WMIKillProcess} name.exe&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the following information to the stack:&lt;br /&gt;
: 1 = if the process found and killed&lt;br /&gt;
: 0 = if the process not found&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
${WMISetPriority} name.exe priority&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Priority can be&lt;br /&gt;
: Low&lt;br /&gt;
: BelowNormal&lt;br /&gt;
: Normal&lt;br /&gt;
: AboveNormal&lt;br /&gt;
: High&lt;br /&gt;
: Realtime&lt;br /&gt;
&lt;br /&gt;
Returns the following information to the stack:&lt;br /&gt;
: 1 = if the process priority was changed&lt;br /&gt;
: 0 = if the process not found&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Header file - Save this as WMI.nsh ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
!ifndef __WMI_Included__&lt;br /&gt;
!define __WMI_Included__&lt;br /&gt;
!include LogicLib.nsh&lt;br /&gt;
!include &amp;quot;TextFunc.nsh&amp;quot;&lt;br /&gt;
!define Explode_WMI &amp;quot;!insertmacro Explode_WMI&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!define WMIGetInfo &amp;quot;!Insertmacro WMIGetInfo&amp;quot;&lt;br /&gt;
!define WMIKillProcess &amp;quot;!Insertmacro WMIKillProcess&amp;quot;&lt;br /&gt;
!define WMISetPriority &amp;quot;!Insertmacro WMISetPriority&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!macro  Explode_WMI Length  Separator   String&lt;br /&gt;
    Push    `${Separator}`&lt;br /&gt;
    Push    `${String}`&lt;br /&gt;
    Call    Explode_WMI&lt;br /&gt;
    Pop     `${Length}`&lt;br /&gt;
!macroend&lt;br /&gt;
 &lt;br /&gt;
Function Explode_WMI&lt;br /&gt;
  ; Initialize variables&lt;br /&gt;
  Var /GLOBAL explString&lt;br /&gt;
  Var /GLOBAL explSeparator&lt;br /&gt;
  Var /GLOBAL explStrLen&lt;br /&gt;
  Var /GLOBAL explSepLen&lt;br /&gt;
  Var /GLOBAL explOffset&lt;br /&gt;
  Var /GLOBAL explTmp&lt;br /&gt;
  Var /GLOBAL explTmp2&lt;br /&gt;
  Var /GLOBAL explTmp3&lt;br /&gt;
  Var /GLOBAL explArrCount&lt;br /&gt;
 &lt;br /&gt;
  ; Get input from user&lt;br /&gt;
  Pop $explString&lt;br /&gt;
  Pop $explSeparator&lt;br /&gt;
 &lt;br /&gt;
  ; Calculates initial values&lt;br /&gt;
  StrLen $explStrLen $explString&lt;br /&gt;
  StrLen $explSepLen $explSeparator&lt;br /&gt;
  StrCpy $explArrCount 1&lt;br /&gt;
 &lt;br /&gt;
  ${If}   $explStrLen &amp;lt;= 1          ;   If we got a single character&lt;br /&gt;
  ${OrIf} $explSepLen &amp;gt; $explStrLen ;   or separator is larger than the string,&lt;br /&gt;
    Push    $explString             ;   then we return initial string with no change&lt;br /&gt;
    Push    1                       ;   and set array&#039;s length to 1&lt;br /&gt;
    Return&lt;br /&gt;
  ${EndIf}&lt;br /&gt;
 &lt;br /&gt;
  ; Set offset to the last symbol of the string&lt;br /&gt;
  StrCpy $explOffset $explStrLen&lt;br /&gt;
  IntOp  $explOffset $explOffset - 1&lt;br /&gt;
 &lt;br /&gt;
  ; Clear temp string to exclude the possibility of appearance of occasional data&lt;br /&gt;
  StrCpy $explTmp   &amp;quot;&amp;quot;&lt;br /&gt;
  StrCpy $explTmp2  &amp;quot;&amp;quot;&lt;br /&gt;
  StrCpy $explTmp3  &amp;quot;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
  ; Loop until the offset becomes negative&lt;br /&gt;
  ${Do}&lt;br /&gt;
    ;   If offset becomes negative, it is time to leave the function&lt;br /&gt;
    ${IfThen} $explOffset == -1 ${|} ${ExitDo} ${|}&lt;br /&gt;
 &lt;br /&gt;
    ;   Remove everything before and after the searched part (&amp;quot;TempStr&amp;quot;)&lt;br /&gt;
    StrCpy $explTmp $explString $explSepLen $explOffset&lt;br /&gt;
 &lt;br /&gt;
    ${If} $explTmp == $explSeparator&lt;br /&gt;
        ;   Calculating offset to start copy from&lt;br /&gt;
        IntOp   $explTmp2 $explOffset + $explSepLen ;   Offset equals to the current offset plus length of separator&lt;br /&gt;
        StrCpy  $explTmp3 $explString &amp;quot;&amp;quot; $explTmp2&lt;br /&gt;
 &lt;br /&gt;
        Push    $explTmp3                           ;   Throwing array item to the stack&lt;br /&gt;
        IntOp   $explArrCount $explArrCount + 1     ;   Increasing array&#039;s counter&lt;br /&gt;
 &lt;br /&gt;
        StrCpy  $explString $explString $explOffset 0   ;   Cutting all characters beginning with the separator entry&lt;br /&gt;
        StrLen  $explStrLen $explString&lt;br /&gt;
    ${EndIf}&lt;br /&gt;
 &lt;br /&gt;
    ${If} $explOffset = 0                       ;   If the beginning of the line met and there is no separator,&lt;br /&gt;
                                                ;   copying the rest of the string&lt;br /&gt;
        ${If} $explSeparator == &amp;quot;&amp;quot;              ;   Fix for the empty separator&lt;br /&gt;
            IntOp   $explArrCount   $explArrCount - 1&lt;br /&gt;
        ${Else}&lt;br /&gt;
            Push    $explString&lt;br /&gt;
        ${EndIf}&lt;br /&gt;
    ${EndIf}&lt;br /&gt;
 &lt;br /&gt;
    IntOp   $explOffset $explOffset - 1&lt;br /&gt;
  ${Loop}&lt;br /&gt;
 &lt;br /&gt;
  Push $explArrCount&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&lt;br /&gt;
!macro WMIGetInfo _NameSpace _Class _Property _CallBackFunction&lt;br /&gt;
#Push registers to stack&lt;br /&gt;
Push $0&lt;br /&gt;
Push $1&lt;br /&gt;
Push $2&lt;br /&gt;
Push $R0&lt;br /&gt;
Push $R1&lt;br /&gt;
Push $R2&lt;br /&gt;
&lt;br /&gt;
#Execute WMI command to stack&lt;br /&gt;
nsexec::exectostack &amp;quot;wmic /NAMESPACE:\\${_NameSpace} path ${_Class} get ${_Property}&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $1&lt;br /&gt;
&lt;br /&gt;
#Trim blank lines&lt;br /&gt;
${TrimNewLines} &amp;quot;$1&amp;quot; $1&lt;br /&gt;
&lt;br /&gt;
#Explode each result to a stack&lt;br /&gt;
${Explode_WMI}  $R1  &amp;quot;$\n&amp;quot; &amp;quot;$1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#The first line is the same as ${_Property} so we remove it from the stack and subtract it from the results&lt;br /&gt;
Pop $2&lt;br /&gt;
IntOp $R1 $R1 - 1&lt;br /&gt;
&lt;br /&gt;
#Loop through results and do stuff here&lt;br /&gt;
${For} $1 1 $R1&lt;br /&gt;
	Pop $2&lt;br /&gt;
	StrCpy $R0 $1&lt;br /&gt;
	StrCpy $R2 $2&lt;br /&gt;
	Call ${_CallBackFunction}&lt;br /&gt;
${Next}&lt;br /&gt;
&lt;br /&gt;
Pop $R2&lt;br /&gt;
Pop $R1&lt;br /&gt;
Pop $R0&lt;br /&gt;
Pop $2&lt;br /&gt;
Pop $1&lt;br /&gt;
Pop $0&lt;br /&gt;
!macroend&lt;br /&gt;
&lt;br /&gt;
!macro WMIKillProcess _ProcName&lt;br /&gt;
Push $0&lt;br /&gt;
Push $1&lt;br /&gt;
nsexec::exectostack &amp;quot;wmic process where name=&#039;${_ProcName}&#039; delete&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
StrCpy $0 $0 2&lt;br /&gt;
${If} $0 == &amp;quot;No&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 0&lt;br /&gt;
${Else}&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 1&lt;br /&gt;
${EndIf}&lt;br /&gt;
!macroend&lt;br /&gt;
&lt;br /&gt;
!macro WMISetPriority _ProcName _Priority&lt;br /&gt;
push $0&lt;br /&gt;
&lt;br /&gt;
StrCpy $0 &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
${If} ${_Priority} == Low&lt;br /&gt;
StrCpy $0 64&lt;br /&gt;
${ElseIf} ${_Priority} == BelowNormal&lt;br /&gt;
StrCpy $0 16384&lt;br /&gt;
${ElseIf} ${_Priority} == Normal&lt;br /&gt;
StrCpy $0 32&lt;br /&gt;
${ElseIf} ${_Priority} == AboveNormal&lt;br /&gt;
StrCpy $0 32768&lt;br /&gt;
${ElseIf} ${_Priority} == High&lt;br /&gt;
StrCpy $0 128&lt;br /&gt;
${ElseIf} ${_Priority} == RealTime&lt;br /&gt;
StrCpy $0 16384&lt;br /&gt;
${EndIf}&lt;br /&gt;
&lt;br /&gt;
${If} $0 != &#039;&#039;&lt;br /&gt;
nsexec::exectostack &amp;quot;wmic process where name=&#039;${_ProcName}&#039; call setpriority $0&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
StrCpy $0 $0 2&lt;br /&gt;
${If} $0 == &amp;quot;No&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 0&lt;br /&gt;
${Else}&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 1&lt;br /&gt;
${EndIf}&lt;br /&gt;
${EndIf}&lt;br /&gt;
!macroend&lt;br /&gt;
!endif&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
Name WMI&lt;br /&gt;
OutFile WMI.exe&lt;br /&gt;
RequestExecutionLevel Admin&lt;br /&gt;
!include WMI.nsh&lt;br /&gt;
!include LogicLib.nsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section &amp;quot;test&amp;quot;&lt;br /&gt;
#List disk drive models:&lt;br /&gt;
${WMIGetInfo} root\CIMV2 Win32_DiskDrive model callback_Function&lt;br /&gt;
&lt;br /&gt;
#List network adapters:&lt;br /&gt;
${WMIGetInfo} root\CIMV2 Win32_NetworkAdapter name callback_Function&lt;br /&gt;
&lt;br /&gt;
#List user accounts on local computer:&lt;br /&gt;
${WMIGetInfo} root\CIMV2 Win32_UserAccount name callback_Function&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Messagebox MB_YESNO &amp;quot;Launch calc.exe&amp;quot; IDNO +3&lt;br /&gt;
sleep 500&lt;br /&gt;
exec &amp;quot;calc.exe&amp;quot;&lt;br /&gt;
${WMIKillProcess} calc.exe &lt;br /&gt;
pop $0&lt;br /&gt;
&lt;br /&gt;
${If} $0 == 0&lt;br /&gt;
detailprint &amp;quot;calc.exe not found&amp;quot;&lt;br /&gt;
${ElseIf} $0 == 1&lt;br /&gt;
detailprint &amp;quot;calc.exe was found and killed&amp;quot;&lt;br /&gt;
${EndIf}&lt;br /&gt;
&lt;br /&gt;
Messagebox MB_YESNO &amp;quot;Launch calc.exe&amp;quot; IDNO +3&lt;br /&gt;
sleep 500&lt;br /&gt;
exec &amp;quot;calc.exe&amp;quot;&lt;br /&gt;
${WMISetPriority} calc.exe High&lt;br /&gt;
pop $0&lt;br /&gt;
&lt;br /&gt;
${If} $0 == 0&lt;br /&gt;
detailprint &amp;quot;calc.exe not found&amp;quot;&lt;br /&gt;
${ElseIf} $0 == 1&lt;br /&gt;
detailprint &amp;quot;calc.exe was found set to high priority&amp;quot;&lt;br /&gt;
${EndIf}&lt;br /&gt;
&lt;br /&gt;
SectionEnd&lt;br /&gt;
&lt;br /&gt;
Function callback_Function&lt;br /&gt;
detailprint &amp;quot;$R0/$R1=$R2&amp;quot;&lt;br /&gt;
FunctionEnd&lt;/div&gt;</summary>
		<author><name>Doug</name></author>
	</entry>
	<entry>
		<id>https://nsis.sourceforge.io/mediawiki/index.php?title=WMI_header&amp;diff=18944</id>
		<title>WMI header</title>
		<link rel="alternate" type="text/html" href="https://nsis.sourceforge.io/mediawiki/index.php?title=WMI_header&amp;diff=18944"/>
		<updated>2010-09-28T18:22:31Z</updated>

		<summary type="html">&lt;p&gt;Doug: Created page with &amp;quot;== Description == This header includes macros to get WMI information, kill processes on 32 and 64 bit OS systems, and set process priority through the WMIC command line.  The res...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
This header includes macros to get WMI information, kill processes on 32 and 64 bit OS systems, and set process priority through the WMIC command line.&lt;br /&gt;
&lt;br /&gt;
The results for getting information are returned to variables within a callback function to allow you to read through multiple results.&lt;br /&gt;
&lt;br /&gt;
There is a huge amount of information that can be retrieved using WMI so I would suggest downloading the [http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&amp;amp;displaylang=en WMI Code Creator] as a reference rather than listing them here.&lt;br /&gt;
Most of the useful information uses &amp;quot;root\CIMV2&amp;quot; as the namespace.&lt;br /&gt;
&lt;br /&gt;
This includes [http://nsis.sourceforge.net/Explode cryonyx&#039;s] Explode macro.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
${WMIGetInfo} Namespace Classes Property callbackfunction&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the following information to a function:&lt;br /&gt;
: $R0 = current result number&lt;br /&gt;
: $R1 = total number of results found&lt;br /&gt;
: $R2 = requested information&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
${WMIKillProcess} name.exe&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Returns the following information to the stack:&lt;br /&gt;
: 1 = if the process found and killed&lt;br /&gt;
: 0 = if the process not found&lt;br /&gt;
&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
${WMISetPriority} name.exe priority&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Priority can be&lt;br /&gt;
: Low&lt;br /&gt;
: BelowNormal&lt;br /&gt;
: Normal&lt;br /&gt;
: AboveNormal&lt;br /&gt;
: High&lt;br /&gt;
: Realtime&lt;br /&gt;
&lt;br /&gt;
Returns the following information to the stack:&lt;br /&gt;
: 1 = if the process priority was changed&lt;br /&gt;
: 0 = if the process not found&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Header file - Save this as WMI.nsh ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
!include LogicLib.nsh&lt;br /&gt;
!include &amp;quot;TextFunc.nsh&amp;quot;&lt;br /&gt;
!define Explode_WMI &amp;quot;!insertmacro Explode_WMI&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!define WMIGetInfo &amp;quot;!Insertmacro WMIGetInfo&amp;quot;&lt;br /&gt;
!define WMIKillProcess &amp;quot;!Insertmacro WMIKillProcess&amp;quot;&lt;br /&gt;
!define WMISetPriority &amp;quot;!Insertmacro WMISetPriority&amp;quot;&lt;br /&gt;
&lt;br /&gt;
!macro  Explode_WMI Length  Separator   String&lt;br /&gt;
    Push    `${Separator}`&lt;br /&gt;
    Push    `${String}`&lt;br /&gt;
    Call    Explode_WMI&lt;br /&gt;
    Pop     `${Length}`&lt;br /&gt;
!macroend&lt;br /&gt;
 &lt;br /&gt;
Function Explode_WMI&lt;br /&gt;
  ; Initialize variables&lt;br /&gt;
  Var /GLOBAL explString&lt;br /&gt;
  Var /GLOBAL explSeparator&lt;br /&gt;
  Var /GLOBAL explStrLen&lt;br /&gt;
  Var /GLOBAL explSepLen&lt;br /&gt;
  Var /GLOBAL explOffset&lt;br /&gt;
  Var /GLOBAL explTmp&lt;br /&gt;
  Var /GLOBAL explTmp2&lt;br /&gt;
  Var /GLOBAL explTmp3&lt;br /&gt;
  Var /GLOBAL explArrCount&lt;br /&gt;
 &lt;br /&gt;
  ; Get input from user&lt;br /&gt;
  Pop $explString&lt;br /&gt;
  Pop $explSeparator&lt;br /&gt;
 &lt;br /&gt;
  ; Calculates initial values&lt;br /&gt;
  StrLen $explStrLen $explString&lt;br /&gt;
  StrLen $explSepLen $explSeparator&lt;br /&gt;
  StrCpy $explArrCount 1&lt;br /&gt;
 &lt;br /&gt;
  ${If}   $explStrLen &amp;lt;= 1          ;   If we got a single character&lt;br /&gt;
  ${OrIf} $explSepLen &amp;gt; $explStrLen ;   or separator is larger than the string,&lt;br /&gt;
    Push    $explString             ;   then we return initial string with no change&lt;br /&gt;
    Push    1                       ;   and set array&#039;s length to 1&lt;br /&gt;
    Return&lt;br /&gt;
  ${EndIf}&lt;br /&gt;
 &lt;br /&gt;
  ; Set offset to the last symbol of the string&lt;br /&gt;
  StrCpy $explOffset $explStrLen&lt;br /&gt;
  IntOp  $explOffset $explOffset - 1&lt;br /&gt;
 &lt;br /&gt;
  ; Clear temp string to exclude the possibility of appearance of occasional data&lt;br /&gt;
  StrCpy $explTmp   &amp;quot;&amp;quot;&lt;br /&gt;
  StrCpy $explTmp2  &amp;quot;&amp;quot;&lt;br /&gt;
  StrCpy $explTmp3  &amp;quot;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
  ; Loop until the offset becomes negative&lt;br /&gt;
  ${Do}&lt;br /&gt;
    ;   If offset becomes negative, it is time to leave the function&lt;br /&gt;
    ${IfThen} $explOffset == -1 ${|} ${ExitDo} ${|}&lt;br /&gt;
 &lt;br /&gt;
    ;   Remove everything before and after the searched part (&amp;quot;TempStr&amp;quot;)&lt;br /&gt;
    StrCpy $explTmp $explString $explSepLen $explOffset&lt;br /&gt;
 &lt;br /&gt;
    ${If} $explTmp == $explSeparator&lt;br /&gt;
        ;   Calculating offset to start copy from&lt;br /&gt;
        IntOp   $explTmp2 $explOffset + $explSepLen ;   Offset equals to the current offset plus length of separator&lt;br /&gt;
        StrCpy  $explTmp3 $explString &amp;quot;&amp;quot; $explTmp2&lt;br /&gt;
 &lt;br /&gt;
        Push    $explTmp3                           ;   Throwing array item to the stack&lt;br /&gt;
        IntOp   $explArrCount $explArrCount + 1     ;   Increasing array&#039;s counter&lt;br /&gt;
 &lt;br /&gt;
        StrCpy  $explString $explString $explOffset 0   ;   Cutting all characters beginning with the separator entry&lt;br /&gt;
        StrLen  $explStrLen $explString&lt;br /&gt;
    ${EndIf}&lt;br /&gt;
 &lt;br /&gt;
    ${If} $explOffset = 0                       ;   If the beginning of the line met and there is no separator,&lt;br /&gt;
                                                ;   copying the rest of the string&lt;br /&gt;
        ${If} $explSeparator == &amp;quot;&amp;quot;              ;   Fix for the empty separator&lt;br /&gt;
            IntOp   $explArrCount   $explArrCount - 1&lt;br /&gt;
        ${Else}&lt;br /&gt;
            Push    $explString&lt;br /&gt;
        ${EndIf}&lt;br /&gt;
    ${EndIf}&lt;br /&gt;
 &lt;br /&gt;
    IntOp   $explOffset $explOffset - 1&lt;br /&gt;
  ${Loop}&lt;br /&gt;
 &lt;br /&gt;
  Push $explArrCount&lt;br /&gt;
FunctionEnd&lt;br /&gt;
&lt;br /&gt;
!macro WMIGetInfo _NameSpace _Class _Property _CallBackFunction&lt;br /&gt;
#Push registers to stack&lt;br /&gt;
Push $0&lt;br /&gt;
Push $1&lt;br /&gt;
Push $2&lt;br /&gt;
Push $R0&lt;br /&gt;
Push $R1&lt;br /&gt;
Push $R2&lt;br /&gt;
&lt;br /&gt;
#Execute WMI command to stack&lt;br /&gt;
nsexec::exectostack &amp;quot;wmic /NAMESPACE:\\${_NameSpace} path ${_Class} get ${_Property}&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $1&lt;br /&gt;
&lt;br /&gt;
#Trim blank lines&lt;br /&gt;
${TrimNewLines} &amp;quot;$1&amp;quot; $1&lt;br /&gt;
&lt;br /&gt;
#Explode each result to a stack&lt;br /&gt;
${Explode_WMI}  $R1  &amp;quot;$\n&amp;quot; &amp;quot;$1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#The first line is the same as ${_Property} so we remove it from the stack and subtract it from the results&lt;br /&gt;
Pop $2&lt;br /&gt;
IntOp $R1 $R1 - 1&lt;br /&gt;
&lt;br /&gt;
#Loop through results and do stuff here&lt;br /&gt;
${For} $1 1 $R1&lt;br /&gt;
	Pop $2&lt;br /&gt;
	StrCpy $R0 $1&lt;br /&gt;
	StrCpy $R2 $2&lt;br /&gt;
	Call ${_CallBackFunction}&lt;br /&gt;
${Next}&lt;br /&gt;
&lt;br /&gt;
Pop $R2&lt;br /&gt;
Pop $R1&lt;br /&gt;
Pop $R0&lt;br /&gt;
Pop $2&lt;br /&gt;
Pop $1&lt;br /&gt;
Pop $0&lt;br /&gt;
!macroend&lt;br /&gt;
&lt;br /&gt;
!macro WMIKillProcess _ProcName&lt;br /&gt;
Push $0&lt;br /&gt;
Push $1&lt;br /&gt;
nsexec::exectostack &amp;quot;wmic process where name=&#039;${_ProcName}&#039; delete&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
StrCpy $0 $0 2&lt;br /&gt;
${If} $0 == &amp;quot;No&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 0&lt;br /&gt;
${Else}&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 1&lt;br /&gt;
${EndIf}&lt;br /&gt;
!macroend&lt;br /&gt;
&lt;br /&gt;
!macro WMISetPriority _ProcName _Priority&lt;br /&gt;
push $0&lt;br /&gt;
&lt;br /&gt;
StrCpy $0 &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
${If} ${_Priority} == Low&lt;br /&gt;
StrCpy $0 64&lt;br /&gt;
${ElseIf} ${_Priority} == BelowNormal&lt;br /&gt;
StrCpy $0 16384&lt;br /&gt;
${ElseIf} ${_Priority} == Normal&lt;br /&gt;
StrCpy $0 32&lt;br /&gt;
${ElseIf} ${_Priority} == AboveNormal&lt;br /&gt;
StrCpy $0 32768&lt;br /&gt;
${ElseIf} ${_Priority} == High&lt;br /&gt;
StrCpy $0 128&lt;br /&gt;
${ElseIf} ${_Priority} == RealTime&lt;br /&gt;
StrCpy $0 16384&lt;br /&gt;
${EndIf}&lt;br /&gt;
&lt;br /&gt;
${If} $0 != &#039;&#039;&lt;br /&gt;
nsexec::exectostack &amp;quot;wmic process where name=&#039;${_ProcName}&#039; call setpriority $0&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
StrCpy $0 $0 2&lt;br /&gt;
${If} $0 == &amp;quot;No&amp;quot;&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 0&lt;br /&gt;
${Else}&lt;br /&gt;
pop $0&lt;br /&gt;
pop $0&lt;br /&gt;
push 1&lt;br /&gt;
${EndIf}&lt;br /&gt;
${EndIf}&lt;br /&gt;
!macroend&lt;br /&gt;
&amp;lt;/highlight-nsis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;highlight-nsis&amp;gt;&lt;br /&gt;
Name WMI&lt;br /&gt;
OutFile WMI.exe&lt;br /&gt;
RequestExecutionLevel Admin&lt;br /&gt;
!include WMI.nsh&lt;br /&gt;
!include LogicLib.nsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Section &amp;quot;test&amp;quot;&lt;br /&gt;
#List disk drive models:&lt;br /&gt;
${WMIGetInfo} root\CIMV2 Win32_DiskDrive model callback_Function&lt;br /&gt;
&lt;br /&gt;
#List network adapters:&lt;br /&gt;
${WMIGetInfo} root\CIMV2 Win32_NetworkAdapter name callback_Function&lt;br /&gt;
&lt;br /&gt;
#List user accounts on local computer:&lt;br /&gt;
${WMIGetInfo} root\CIMV2 Win32_UserAccount name callback_Function&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Messagebox MB_YESNO &amp;quot;Launch calc.exe&amp;quot; IDNO +3&lt;br /&gt;
sleep 500&lt;br /&gt;
exec &amp;quot;calc.exe&amp;quot;&lt;br /&gt;
${WMIKillProcess} calc.exe &lt;br /&gt;
pop $0&lt;br /&gt;
&lt;br /&gt;
${If} $0 == 0&lt;br /&gt;
detailprint &amp;quot;calc.exe not found&amp;quot;&lt;br /&gt;
${ElseIf} $0 == 1&lt;br /&gt;
detailprint &amp;quot;calc.exe was found and killed&amp;quot;&lt;br /&gt;
${EndIf}&lt;br /&gt;
&lt;br /&gt;
Messagebox MB_YESNO &amp;quot;Launch calc.exe&amp;quot; IDNO +3&lt;br /&gt;
sleep 500&lt;br /&gt;
exec &amp;quot;calc.exe&amp;quot;&lt;br /&gt;
${WMISetPriority} calc.exe High&lt;br /&gt;
pop $0&lt;br /&gt;
&lt;br /&gt;
${If} $0 == 0&lt;br /&gt;
detailprint &amp;quot;calc.exe not found&amp;quot;&lt;br /&gt;
${ElseIf} $0 == 1&lt;br /&gt;
detailprint &amp;quot;calc.exe was found set to high priority&amp;quot;&lt;br /&gt;
${EndIf}&lt;br /&gt;
&lt;br /&gt;
SectionEnd&lt;br /&gt;
&lt;br /&gt;
Function callback_Function&lt;br /&gt;
detailprint &amp;quot;$R0/$R1=$R2&amp;quot;&lt;br /&gt;
FunctionEnd&lt;/div&gt;</summary>
		<author><name>Doug</name></author>
	</entry>
</feed>