-
I know there is a way to do this, this i what i want to do:
1) Determine when an EXE, COM, or BAT file is loaded.
2) Tell windows to cancel running it.
3) Allow my program to scan it.
4) Then make my program run it.
(i bet it's all API! hehe)
Any help is worth thanking... :)
-da404LewZer
-
Do you want to get an event or is timer ok?
-
Anyone??
C'mon i need to know how... and yes i will most likely be using a timer, unless it's not needed. I got the exe scanning thing already werking.. i just wanna know how 2 do 1,2,and 4.
Please help.
-
You can do this by editing the registry. If you have a look under the HKEY_CLASSES_ROOT you will find all registred file types including BAT, COM and EXE. Take a look at the key .bat and you will see a value in the right pane (probably batfile). Then scroll down to that key (batfile) and change the value under shell\open\command from "%1" %* to YourProgramPathAndName "%1" %*. Now every time you try to start a .BAT file you program starts and you will get the path and filename of the .BAT file as a command argument.
Use the Command$() function to read the command line. Run your scan of the file and then use the Shell function to launch the .BAT file.
Now do the same for .COM and .EXE files in the registry.
Good luck!