Simon Mourier's Avatar
Simon Mourier's blog (1807 answers on StackOverflow) about Microsoft technologies C#, C/C++, .NET, WinRT, WinUI3, AOT, P/Invoke, COM, Interop, DirectX, Direct2D, Windows, ...
  • 🔎︎ Search
  • Categories
  • Archives
  • About Me
  • architecture
  • c/c++
  • winapi

Why does windows spawn process sometimes trigger error STATUS_SXS_ASSEMBLY_NOT_FOUND?

Jun 18, 2012 See the question and my original answer on StackOverflow

As specified here _spawn, _wspawn Functions, only the functions with a 'p' letter in the name implicitely use the PATH environment variable. The others don't.

So you need to do this:

char *args[] =  {"notepad.exe", NULL };
_spawnvpe(_P_NOWAIT, args[0], args, NULL);
  • SmoBlog © 2010-2026 Simon Mourier. All rights reserved.
  • Privacy & Terms