Quantcast
Channel: Mentor Graphics Communities: Message List
Viewing all articles
Browse latest Browse all 4541

Re: Cant get CellEditor to close after script Run

$
0
0

windows - How to terminate process using VBScript - Stack Overflow

 

Or a number of other methods which are basically similar: Google

 

Or something like this example I use to terminate Library Manager, which in the past was known for hanging open:

 

Sub Application_Quit()

         Dim AllProcess

         Dim Process

         Dim strFoundProcess

         Dim i

         strFoundProcess = False

         Set AllProcess = getobject("winmgmts:") 'create object

         i = 0

        

         DoWhile i < 3 '3 is just a guess, make it bigger if needed.

           ForEach Process In AllProcess.InstancesOf("Win32_process") 'Get all the processes running in your PC

             If (Instr (Ucase(Process.Name),"LIBRARYMANAGER.EXE") = 1) Then' Replace with your application name in CAPS.

              ' Msgbox Process.Name & " Application is already running"

               Process.Terminate()

               scripting.sleep (1000) 'Wait for a while to kill the process

               strFoundProcess = True

               Exitfor

             EndIf

           Next

           i = i + 1

         Loop

         Set AllProcess = Nothing

EndSub


Viewing all articles
Browse latest Browse all 4541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>