Hvordan kan vi hjælpe dig i dag?

Example of script to check if another process is running

DISCLAIMER

This sample program is intended to demonstrate one or more programming functions or methods and is presented as programming example only. Schneider Electric assumes no liability for the use or application of this example program or any portion thereof.


This is an example of a mimic script to check if a particular process is running. When execute, an input box would be displayed prompting the user to enter the full name of the process to be checked. For example, for Internet Explorer, one needs to enter "iexplore.exe" (without the quotation marks) into the input box.

Sub CheckProc

Dim i
Dim strComputer
Dim FindProc

strComputer = "."

FindProc = inputbox("Enter process name","Information required")

Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
    ("Select Name from Win32_Process WHERE Name LIKE '" & FindProc & "%'")

If colProcessList.count>0 Then
    msgbox (FindProc & " is running")
Else
    msgbox (FindProc & " is not running")
End if 

Set objWMIService = Nothing
Set colProcessList = Nothing

End Sub

Schneider Electric Danmark

Se mere
Område:
Se mere
Område:

Brug for hjælp?

Brug for hjælp?

Produktvælger

Produktvælger

Find hurtigt og nemt de rette produkter og det rette tilbehør til dine anvendelser.

Få et tilbud

Få et tilbud

Start din salgsforespørgsel online, så vil du blive kontaktet af en ekspert.

Find forhandler

Find forhandler

Find den nærmeste Schneider Electric-distributør.

Hjælpecenter

Hjælpecenter

Find supportressourcer til alle dine behov på ét sted.

  • Produktdokumentation
  • Download af software
  • Produktvælger
  • Udskiftning og erstatning af produkter
  • Hjælp og kontaktcenter
  • Find forhandler
  • Projektrådgivning
  • Find vores kontorer
  • Schneider Electric Community
  • Karriere
  • Virksomhedsprofil
  • Rapportér en forseelse
  • Tilgængelighed
  • Presserum
  • Investorer
  • EcoStruxure
  • Jobsøgning
  • Blog
  • Privatlivspolitik
  • Cookiemeddelelse
  • Vilkår for anvendelse
  • Rediger dine cookieindstillinger