On Windows you can use GetModuleFileName() http://msdn.microsoft.com/en-us/library/ms683197%28VS.85%29.aspx to get the executable name directly without scanning the path.
On Windows you can use GetModuleFileName() http:// msdn.microsoft. com/en- us/library/ ms683197% 28VS.85% 29.aspx to get the executable name directly without scanning the path.