Run a windows command/script when a specific program opens/closes

10,498

you could wrap the call to vlc in a batch file:

call preexec.cmd
start /b /wait "" vlc.exe
call postexec.cmd

then just replace the shortcut to start vlc with a shortcut to this batch file. unfortunately this will open a consome window, of course.

Share:
10,498
Jordan
Author by

Jordan

Updated on June 05, 2022

Comments

  • Jordan
    Jordan almost 2 years

    Is there a simple way to run a small command or batch script when a specific program opens or closes? I thought there might be a way to make it create a Windows event that I could then use as a trigger in the Task Scheduler, but I couldn't find any events for it.

    The program I'm trying to use as a trigger is VLC Media Player.