closing an application with wsf script 
Author Message
 closing an application with wsf script

I start two applications in a script, one is for support of the other.
While the user closes the main application the supporting stays open, I want
that one to be close by the script.
I start it with this part of the script:

Set Oexec=WshShell.Exec("X:\censured\test.EXE")
Set Oexec=WshShell.Exec("X:\censured\test2.EXE")

Thnx in advance



Tue, 28 Sep 2004 14:48:42 GMT  
 closing an application with wsf script

08:48:42 in microsoft.public.scripting.wsh, Lorenz

Quote:
>I start two applications in a script, one is for support of the other.
>While the user closes the main application the supporting stays open, I want
>that one to be close by the script.
>I start it with this part of the script:

>Set Oexec=WshShell.Exec("X:\censured\test.EXE")
>Set Oexec=WshShell.Exec("X:\censured\test2.EXE")

>Thnx in advance

I think there are several things your script needs to do:
1) Tell if test is running;
2) Tell if test2 is running;
3) Stop test if test is running and test2 is not running.
4) Repeat 3) while test is running.
You can probably use SendKeys techniques to control the applications and
a one second sleep in the loop to avoid your script using too much CPU.
If you control the internals of test and test2, you can use more
reliable techniques.
--
Walter Briscoe


Tue, 28 Sep 2004 17:13:01 GMT  
 closing an application with wsf script

Quote:
> >Thnx in advance
> I think there are several things your script needs to do:
> 1) Tell if test is running;
> 2) Tell if test2 is running;
> 3) Stop test if test is running and test2 is not running.

How what's the syntax??
Close.????
Quote:
> 4) Repeat 3) while test is running.
> You can probably use SendKeys techniques to control the applications and
> a one second sleep in the loop to avoid your script using too much CPU.
> If you control the internals of test and test2, you can use more
> reliable techniques.
> --
> Walter Briscoe



Tue, 28 Sep 2004 22:27:45 GMT  
 closing an application with wsf script

Quote:

> I think there are several things your script needs to do:
> 1) Tell if test is running;
> 2) Tell if test2 is running;
> 3) Stop test if test is running and test2 is not running.
> 4) Repeat 3) while test is running.
> You can probably use SendKeys techniques to control the applications and
> a one second sleep in the loop to avoid your script using too much CPU.

You could use WMI for both the testing of presence and for the closing of the
app.

--
torgeir



Tue, 28 Sep 2004 22:32:58 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Killing an application when another application is closed

2. Script for opening and closing an application...

3. Launching an application from .wsf file

4. calling the wsf from the wsf

5. WSF include another WSF

6. .wsf referenced from another .wsf

7. Detecting and Closing Applications

8. closing word application when printer still has jobs

9. Open application in background and close again.

10. VBScript to close application

11. closing an application

12. closing word application when printer still has jobs

 

 
Powered by phpBB® Forum Software