Деструктор не называют, потому что оконечный () для необработанного исключения назван, прежде чем стек раскручен.
определенные детали того, что говорит спецификация C++, за пределами моего знания, но трассировка отладки с gdb и g ++, кажется, подтверждает это.
Согласно черновой стандарт раздел 15,3 маркеров 9:
9 If no matching handler is found in a program, the function terminate() (_except.terminate_) is called. Whether or not the stack is unwound before calling terminate() is implementation-defined.
Launch cmd.exe instead with the command to run, and specify that the output be written to a file.
runas /user:myDomain\myUserId "cmd.exe /c net stop serviceName > output.txt"
You can use 2> for error output from net stop.