When starting an application, run Windows task

1

I'm looking for a way to run a windows task whenever an application starts. I need to run a VBS or a BAT whenever an application is started (it is started by a second app after the user enters their login and password in it) ...

Does anyone know if this is possible? Can I create a trigger, or something? a service that is reading the windows log and if "X" application is started it does something?

    
asked by anonymous 24.12.2014 / 18:17

2 answers

1

Let's say you want to run y.exe whenever x.exe runs. What you can do is:

  • Rename x.exe to z.exe .
  • Create a new program x.exe that runs both the z.exe and the y.exe , passing z.exe to the same received command line parameters (or if it is interesting, some different parameters).
  • 24.12.2014 / 18:21
    1

    You can create a service that monitors the list of active processes and detects the presence of the application in question.

    If you are going to use .NET, the list of processes can be accessed with System.Diagnostics.Process.GetProcesses() .

        
    24.12.2014 / 18:22