batch file opens when clicking on a program.

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
dell155000
Posts: 2
Joined: 04 Jan 2017 10:38

batch file opens when clicking on a program.

#1 Post by dell155000 » 04 Jan 2017 10:49

is there a possibility to make a batch file that opens when clicking on a program like a browser?

thnx

Sounak@9434
Posts: 100
Joined: 16 Dec 2016 22:31

Re: batch file opens when clicking on a program.

#2 Post by Sounak@9434 » 04 Jan 2017 11:33

Maybe without hacking the software itself it's tough to achive. Though if you are using it for yourself or someone who is little literate in computer you can do this-
1) write the batch file you want to run when clicked in the software and save it in the software directory.
2) Write another batch file that would open the batch file and then the software
2.5) *optional* use any bat to exe converter and convert the 2nd file to exe
3) Change the 2nd batch file's icon to the software icon and then replace all the shortcuts to the software to the 2nd batch file.
It's absolutely not a solution but if you want to do this to trick your friends this may work. :)

Sounak

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: batch file opens when clicking on a program.

#3 Post by aGerman » 04 Jan 2017 11:40

a batch file that opens
No. A not-running code doesn't do anything and thus, can't run itself.
You would need something that observes the running processes and raises an event. This event can be used to run a batch file.
E.g. you could enable the Audit Process Creation in the group policy and create a scheduled task that is waiting for a certain event and runs the batch script.
Another possibility would be running a script without a window (VBScript, JScript, ...) that observes process creation events using WMI and runs your batch script if a certain process was created.

Steffen

Post Reply