/build/static/layout/Breadcrumb_cap_w.png

Check process and install

Hello Guys,
from the last few days I have been creating a script to check if a particular process is running and then proceed for installation. Based on some feed back from other mods of ITNINJA, i finally came up with a script

 

 

set oshell=createobject("wscript.shell")
strMessage="Close the notepad"
strTitle="Warning"

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

oreturn=oshell.popup("Do you want to start the installation",0,"Information",&H0 + &H40)

Do
    Set colProcessList = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = 'notepad.exe'")
    If colProcessList.Count>0 Then
    ortn=oshell.popup(strMessage,0,strTitle,&H0 + &H40)
    End If
Loop While colProcessList.Count>0

 

 

 

 

feel free to play with it as modify as per your needs.
Hope this helps


Comments

  • No offence, but you've spent *days* creating a script, similar examples of which abound on the web? - anonymous_9363 10 years ago
    • by days , i wanted to mention 2 days and not that i was spending whole day in it....but a few minutes. And yes you are right , there are examples on web, but , creating one all by yourself, gives u much better understanding of the script you are writing , also it keeps your brain muscles at work :) - talonsprem87 10 years ago
This post is locked
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ