W
W
wenzeslaus2021-07-10 22:39:34
Windows
wenzeslaus, 2021-07-10 22:39:34

How to automatically launch an application when another application starts?

I need to make sure that any program (let's say a notepad) is launched along with any other program. It is important that this is not when running any script. I concretize my thoughts by simulating the situation: The user opens a browser and another program is launched with it (let's say a notepad). How can this be implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri Slinkin, 2021-07-11
@wenzeslaus

correcting Wataru a little , this can be done not only with a service.
either actually do a service ( batch file description ):
shortcut to run a batch script in the autorun folder i.e. in "%AppData%\Microsoft\Windows\Start Menu\Programs\Startup" which is set to a minimized window and which causes the window to be hidden, let's say , via PowerShell:
%WinDir%\System32\WindowsPowerShell\v1.0\PowerShell.exe -windowstyle hidden
and then do its thing in a loop (tasklist | find /i "...")
or do it in the style of software developers, let's say , on the examples of ConEmu, Clink or AkelPad- create an entry in the registry about "redirecting" the executable file for the specified executable file. (you can make a batch script run to launch programs, and it will be launched by this method)
the first method requires an active process, but most likely will work (since people sometimes restrict access to reg.exe and regedit.exe), and the second method does not requires an active process (one-time, occasional), but may require thoughtful code. in fact, to run more than one program by editing the registry, a script is required, and therefore, I believe, there is no way without scripts.
by the way, for that matter, you can do perversions in the style of copying cmd.exe into, for example, the %Temp% folder by changing it and using it instead of cmd.exe (you can even get the PID of the parent cmd.exe and end the cmd.exe process from child process with a different executable name). you can also start processes in python using subprocess or os, and make an executable (.exe) file through pyinstaller. True, such a program will be slow, but it will have, for example, its own (custom) icon and the name of the executable file in TaskMgr.

W
Wataru, 2021-07-11
@wataru

This can only be done by having some program constantly running in the system. You need to monitor running processes and, if a trigger process has started, start your load.
You can hang a hook to create processes in explorer.exe
PS Criminal article 273 applies for creating viruses.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question