Are you seeing an unexpected behavior that every time your exe is executed in a new cmd window? Then try using the elevated cmd in Windows 7. In start menu type 'cmd' and press 'Ctrl+Shift+Enter' (instead of 'Enter') to open the cmd window. Now your exe should work in the same cmd window where you trigger it.
Note: The reason for a opening a new cmd window is that your exe needs some elevated permissions to execute which the restricted cmd doesn't have.
Note: The reason for a opening a new cmd window is that your exe needs some elevated permissions to execute which the restricted cmd doesn't have.