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