Highlighted
besafe Contributor.
Contributor.
1046 views

is it possible to close down applications through a script?

Hello Community,

i was wondering if it was possible to close down applications, through your script so when its done it essentially gives you a clear screen with only the script being open?

0 Likes
5 Replies
TomFitz Absent Member.
Absent Member.

RE: is it possible to close down applications through a script?

Hi Besafe,

you lost me at "Hello " !! lol.

Can you elaborate? What is the scenario and these applications are then running in the terminal sessions (host application) or on the desktop (Windows applications)? If Windows application did you launch them from the macro? If Windows applications and you did not launch them from the macro, you could send WM_Close Windows messages to each app having found the handle, but this can be tricky if you encounter save prompts etc.

Bottom live we need more info, a general description of whats open, who opens it, and whether you really want to close these apps of simply minimise them before you show the script (in the script editor) is assume.

Tom
0 Likes
besafe Contributor.
Contributor.

RE: is it possible to close down applications through a script?

HI TomFitz,

sorry for loosing you that soon 😄

i will try and be more clear 😄

I am launching a application from my desktop before im starting my script...however if it is also possible to start my application by only starting my script that would be great. nevertheless when my script is done i would like to close the application completely down.However you say that it might be tricky if you encounter save prompts, and with this exact file there will always be a save prompt when closing down, what do you mean by that
0 Likes
TomFitz Absent Member.
Absent Member.

RE: is it possible to close down applications through a script?

Hi Besafe,

1. Is the application MS Excel (or some other Office application)? I'm guessing yes, as you should only get a save prompt if you modify something in the application, and I assume your script is modifying whatever you have launched.
2. You can launch your application from the script, normally I use CreateProcess from Kernel32.dll (which I've not tried yet in Rumba Basic), but alternatively you could use Shell or if it has a COM/OLE API (as is the case with MS Office apps) then we should be able to launch it using that API also.
3. Using WM_Close messages to close an app is similar to clicking on the X in the top right of the window frame. If a save prompt appears then we need to look for that prompt and deal with it. If this save prompt always appears then that simplifies things a little.

So what app are you launching and do you want to save the changes when prompted?

Also, in terms of your script window, are you executing the script from the Rumba Script Editor? If not we will need to launch it and open your script and the end of the script execution.

Sorry for the interrogation, but I need answers also 🙂

Tom
0 Likes
Tutt456 Absent Member.
Absent Member.

RE: is it possible to close down applications through a script?

Closing Outlook via a script. Unlike being able to start Outlook via a a scheduled task, the Task Scheduler in Windows sadly doesn't have a “close application” option. However, you can use a simple vbs-script for it to close Outlook gracefully or even kill the process krogerfeedback.

0 Likes
besafe Contributor.
Contributor.

RE: is it possible to close down applications through a script?

actually the application i need to close is the script itself, i have created a scheduled task which opens the script, but when the script is opened it open as the script player window. what i would like it to do, is to "commit suicide" and close it self down.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.