GetModuleFileName

[DllImport("coredll.dll", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern uint GetModuleFileName(
   IntPtr hModule,
   StringBuilder lpFilename,
   uint nSize
);

Microsoft documentation: Link

Last updated