Prevent Dopus from being ran as administrator


Is there a Dopus built in way to detect if Dopus has been "Run As Administrator" in Windows 10. I use Function OnInit in a vbs script at startup to carry out a number of pre-flight checks. I would like to force Dopus to close (possibly with a message) if the executable was incorrectly ran with elevated permissions. The only solution I have found so far is to run the following powershell command which counts how many of the named process are running with elevated permissions (0 ok, 1 or more, elevated).

(Get-Process | where {$_.ProcessName -match 'dopus'} | Add-Member -Name Elevated -MemberType ScriptProperty -Value {if ($this.Name -in @('Idle','System')) {$null} else {-not $this.Path -and -not $this.Handle} } -PassThru | Format-Table Name,Elevated | out-string -stream | Select-string 'true' | measure-object).count

If there is no other way, could you offer some syntax on how best I could run this powershell command from the opening vbs script and act upon the result.

Some good answers here:

Few more here, but they look more complex: