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?

dadadidudu
  • 111
  • 2
  • I don't see how you can so this if the command prompt itself is not closing the process – Ramhound Sep 05 '13 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. – Oliver Salzburg Sep 05 '13 at 21:24
  • Yeah right, `start /w` did the trick. Then I just had to hide the command window for which I used [hstart.](http://www.howtogeek.com/howto/windows/hide-flashing-command-line-and-batch-file-windows-on-startup/) Thanks! – dadadidudu Sep 05 '13 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 http://superuser.com/questions/191149/how-to-execute-cmd-exe-silently and also with an example here http://superuser.com/questions/62525/run-a-completly-hidden-batch-file – barlop Sep 06 '13 at 01: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 http://linux.die.net/man/ – barlop Sep 06 '13 at 01:10
  • @dadadidudu: If you found a solution to your problem, please post your own answer and mark it as the solution when the option becomes available. Thanks – Oliver Salzburg Sep 06 '13 at 09:10

0 Answers0