Why does Windows make it so hard to trigger an event based on an exe?


Valour549

New member
Local time
2:44 PM
Posts
24
OS
Windows 11
I want Program B to open whenever Program A is opened.

Trying to create such a task in Task Scheduler is very hard because the "On an event" trigger asks for Log, Source, and Event ID, which I don't think is even possible to get because Event Viewer doesn't log every exe you open and the Event ID changes anyways.

Now I know the typical response is "just write a batch file so the two programs open at the same time", but that's not a proper solution because it means Program A has to be started from that batch file every time. In reality, there are so many ways Program A can commence, and in all of them bar one Program B would not follow.

I just don't understand why Task Scheduler makes it so hard to do something that should be so goddamn simple.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
You could enable auditing of process creation, which is off by default. In the local group policy editor, navigate to Computer Configuration | Windows Settings | Security Settings | Advanced Audit Policy Configuration | System Audit Policies | Detailed Tracking. From there, you can audit process creation.

Then, you would just need to monitor for process 4688.

 

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
    Antivirus
    Microsoft Defender
  • Operating System
    Linux Mint 21.2 (Cinnamon)
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC8i5BEH
    CPU
    Intel Core i5-8259U CPU @ 2.30GHz
    Memory
    32 GB
    Graphics card(s)
    Iris Plus 655
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
  • To enable auditing for successful process creations:
auditpol /set /subcategory:"Process Creation" /success:enable

  • To disable auditing for successful process creations:
auditpol /set /subcategory:"Process Creation" /success:disable
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
Too bad atm I only have Windows 11 Home, but I shall bookmark this, thanks
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
Not sure what this thread means -- there's plenty of ways of creating a programmable interrupt -- I'm sure even the bog standard Windows published API will have some programmable interrupts -- I'm not a Windows internals person by any manner but an interrupt in any OS is usually serviced before any other process. A few are obviously in the hardware bios such as the keyboard which generates a hardware interrupt and has the highest priority in the system. Even the old MsDos had a command line INT(X) which would generate an interupt.

cheers
jimbo
 

My Computer

System One

  • OS
    Windows XP,7,10,11 Linux Arch Linux
    Computer type
    PC/Desktop
    CPU
    2 X Intel i7
I want Program B to open whenever Program A is opened

Stardock Groupy 2 will do that and more. I bought it when they made it and only just started to use it.
I just love having Photoshop and Adobe Bridge open together, along with my FTP program and old copy of Dreamweaver.

Or Word and Excel open with Outlook, or Outlook open with Firefox etc etc

 

My Computers

System One System Two

  • OS
    Windows 11 Pro 23H2 Build 22631.5039
    Computer type
    PC/Desktop
    Manufacturer/Model
    Sin-built
    CPU
    Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz (4th Gen?)
    Motherboard
    ASUS ROG Maximus VI Formula
    Memory
    32.0 GB of I forget and the box is in storage.
    Graphics Card(s)
    Gigabyte nVidia GeForce GTX 1660 Super OC 6GB
    Sound Card
    Onboard
    Monitor(s) Displays
    4 x LG 23MP75 - 2 x 24MK430H-B - 1 x Wacom Pro 22" Tablet
    Screen Resolution
    All over the place
    Hard Drives
    Too many to list.
    OS on Samsung 1TB 870 QVO SATA
    PSU
    Silverstone 1500
    Case
    NZXT Phantom 820 Full-Tower Case
    Cooling
    Noctua NH-D15 Elite Class Dual Tower CPU Cooler / 6 x EziDIY 120mm / 2 x Corsair 140mm somethings / 1 x 140mm Thermaltake something / 2 x 200mm Corsair.
    Keyboard
    Corsair K95 / Logitech diNovo Edge Wireless
    Mouse
    Logitech G402 / G502 / Mx Masters / MX Air Cordless
    Internet Speed
    100/40Mbps
    Browser
    All sorts
    Antivirus
    Kaspersky Premium
    Other Info
    I’m on a horse.
  • Operating System
    Windows 11 Pro 23H2 Build: 22631.4249
    Computer type
    Laptop
    Manufacturer/Model
    LENOVO Yoga 7i EVO OLED 14" Touchscreen i5 12 Core 16GB/512GB
    CPU
    Intel Core 12th Gen i5-1240P Processor (1.7 - 4.4GHz)
    Memory
    16GB LPDDR5 RAM
    Graphics card(s)
    Intel Iris Xe Graphics Processor
    Sound Card
    Optimized with Dolby Atmos®
    Screen Resolution
    QHD 2880 x 1800 OLED
    Hard Drives
    M.2 512GB
    Antivirus
    Defender / Malwarebytes
    Other Info
    …still on a horse.
Did you see these discussions?

I tested the answer that detailed how to use Bill2's Process Manager and it was easy to set up and worked perfectly. As a a test, I set up a simple rule to launch 7-Zip when MSPaint is opened and it did exactly that.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
I tested the answer that detailed how to use Bill2's Process Manager and it was easy to set up and worked perfectly. As a a test, I set up a simple rule to launch 7-Zip when MSPaint is opened and it did exactly that.
How resource-heavy is Bill2's Process Manager when compared to the other method (that, BTW, I already outlined in my 1st reply to this thread)? I suspect that this program just keeps polling the process list constantly to detect changes in it through WMI, as it has to be always running in the background to achieve its goal. Polling is a highly primitive strategy. It should be avoided when possible to avoid, and, in this case avoiding it is both possible and relatively very easy.
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
How resource-heavy is Bill2's Process Manager when compared to the other method (that, BTW, I already outlined in my 1st reply to this thread)? I suspect that this program just keeps polling the process list constantly to detect changes in it through WMI, as it has to be always running in the background to achieve its goal. Polling is a highly primitive strategy. It should be avoided when possible to avoid, and, in this case avoiding it is both possible and relatively very easy.
Good points. I took another look. BPM appears to use very little CPU, but its memory footprint at 22.3 MB seems a bit excessive if all you need to do is launch another program. If the OP can get it done with Task Manager, I agree, that would be best.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
Another method is to use Image File Execution Options (IFEO), to force every instance of trying to run ProgramA, to execute a batch script which runs both ProgramA and ProgramB at the same time. Every time ProgramA is called, Windows substitutes another command in its place.

The catch is ProgramA's executable must be renamed to a different filename to prevent an infinite loop (otherwise ProgramA launches a script to run ProgramA, which in turn runs the script again). The IFEO method removes all need for the Event logger or polling.

Code:
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ProgramA.exe" /t REG_SZ /v Debugger /d "C:\myscripts\wrapper.bat" /f

wrapper.bat
Code:
ProgramA_other.exe
ProgramB.exe

To revert the IFEO:
Code:
reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\ProgramA.exe" /f
 

My Computer

System One

  • OS
    Windows 7
The catch is ProgramA's executable must be renamed to a different filename to prevent an infinite loop (otherwise ProgramA launches a script to run ProgramA, which in turn runs the script again). The IFEO method removes all need for the Event logger or polling.
Another catch appears to be with Store apps. I could not get Windows 11 mspaint or notepad to work with IFEO. Maybe there's some trick with the "UseFilter" value, but I had no success.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
You're correct, UWP apps are exempt from IFEO. I don't think UWP has a similar debugging hook.
 

My Computer

System One

  • OS
    Windows 7
Another catch appears to be with Store apps. I could not get Windows 11 mspaint or notepad to work with IFEO. Maybe there's some trick with the "UseFilter" value, but I had no success.
what if you made a .bat or .cmd to (or ahk compiled as .exe) to run the store app?
 

My Computer

System One

  • OS
    Windows 11 Pro
what if you made a .bat or .cmd to (or ahk compiled as .exe) to run the store app?
I already tried a C# exe and couldn't get store apps to work. The infinite loop issue also makes it inconvenient. It looks like a scheduled task is still the best option.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer

Latest Support Threads

Back
Top Bottom