1

On Windows 7, I want to execute a command-line after I close a certain process (in my case ehshell.exe). The thing is, I'd prefer not to use any external program and I'd like to prevent having to use a .cmd with taskkill in it.

I already tried using the task planer to execute my command, but I failed to set an event trigger for the task because ehshell has no event ID for closing down. I even tried to enable logging for process creation and termination in gpedit.msc but that also didn't work as expected because it really logs all processes and not just a specific one.

Did I miss something? Any ideas?

6
  • I don't see how you can so this if the command prompt itself is not closing the process
    – Ramhound
    Sep 5, 2013 at 21:23
  • 3
    Why don't you just start eshell.exe through a batch file that simply starts eshell.exe and runs whatever you want afterwards? The second command will not start until you close eshell.exe so it should work out fine. Sep 5, 2013 at 21:24
  • Yeah right, start /w did the trick. Then I just had to hide the command window for which I used hstart. Thanks!
    – dadadidudu
    Sep 5, 2013 at 22:46
  • @dadadidudu vbscript is more modern than batch, I suppose is more powerful, and also wouldn't bring a cmd window up, and would be native, no third party program other than the little script you use to run the program! ideal for a situation like this when there's no particular reason to use the command line - vbscript mentioned briefly in a comment on an answer here superuser.com/questions/191149/how-to-execute-cmd-exe-silently and also with an example here superuser.com/questions/62525/run-a-completly-hidden-batch-file
    – barlop
    Sep 6, 2013 at 1:09
  • @OliverSalzburg &/questioner, can eshell be run outside of emacs? wouldn't he/you have to start emacs to run eshell? I don't see eshell listed here linux.die.net/man
    – barlop
    Sep 6, 2013 at 1:10

0

You must log in to answer this question.

Browse other questions tagged .