Run EXE in background

How to make for EXE application run in background in WIndows 10?
I use RPA.Windows.Windows_Run(‘application.exe’) in Python script.

Hi, can you provide more details about the use-case? Like:

  1. Does the current solution you have suit you already?
  2. Do you want to also minimize the window or have it hidden?
  3. Would Open Application (RPA.Desktop) help you more in this case? (if the above isn’t enough)

Usually these keywords aren’t blocking, so you can open the app and then have the robot logic continue its flow. Additionally, we also support the following:

  • Run (OperatingSystem)
  • Run Process (Process – better configuration support)

Don’t forget to close the window/app at the end:

RPA.Windows

RPA.Desktop

Dear Cosmin

Python script runs normally, the problem is that the application runs on a server where other people access it.
The task in Windows, for the execution of this robot, is executed every 5 minutes, so, as there are other people accessing the server, the execution of the robot should not appear, that is, the execution should be hidden, but this is not happening.
I don’t know if I could explain it for you to understand.

1 Like

I understand it now, so the best option would be for the app itself to support being run in some sort of “headless” mode (so no window displayed) through an executable parameter you can pass while running it with either Open Application or Run Process.
If the app doesn’t support such parameter (which you have to research about and test manually first), you can try minimizing the app as soon as it starts with Minimize Window. (but that will still show it in the taskbar)

If you still have trouble with it, you can share with us the app if possible so we can look into a solution together.

Create a .bat file to run and place this code, changing it to your project path.

Code:

rem Insert the bot path
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start “” /min “%~dpnx0” %* && exit

cd C:\Bots\Bot1\Project
rcc run -e devdata\env.json

exit

Create Folder devdata and file env.json in Visual studio Code.

devdata/env.json

1 Like

Thanks JSantana.
I will try to run it this way.

Sorry, but, what should be the contents of the env.json file?

After exec : rcc run -e devdata\env.json
This message :
Traceback (most recent call last):

  • File “C:\projetos\Python\resetar_senha_apps\resetar_senha_apps.py”, line 11, in import conn*
  • File “C:\projetos\Python\resetar_senha_apps\conn.py”, line 5, in import cx_Oracle*
    ModuleNotFoundError: No module named ‘cx_Oracle’
    Error: exit status 1

env.json

{
“RPA_WINDOWS”: “RPA.Windows”
}

robot.yaml

tasks:
Run Python:
shell: python resetar_senha_apps.py

condaConfigFile: conda.yaml
artifactsDir: output
PATH:

  • .
    PYTHONPATH:
  • .
    ignoreFiles:
  • .gitignore

Just to clarify, environment files (env.json) are development time option to simulate production like settings (to provide environment variables to executed robot process) in development work (for example in VS Code). They should not be used in real production as Control Room/Workforce Agent runs provides those environment variables.

And content of env.json is just “key/value” pairs, that rcc will inject into robots execution environment before starting actual robot run.

Can you provide your conda.yaml and also tell, what should be providing that cx_Oracle module? Is this self-made module, or should some dependency bring that in?