windows - CreateprocessW change environment variables for python's lib call -


wchar_t cmd2[] = l"cmd.exe";  startupinfow startinf;  memset( &startinf, 0, sizeof startinf ); startinf.cb = sizeof(startinf);  process_information procinf; memset( &procinf, 0, sizeof procinf );  bool b = createprocessw( null, cmd2, null, null, false,     normal_priority_class| create_new_console, "pythonpath=\"c:\\program files\\anaconda\\lib;c:\\program files\\anaconda\\lib\\site-packages\0\0\"", null, &startinf, &procinf );   std::cout << "retour de la commande createprocess= " << b << std::endl; 

i tried previous code in order open console , run python scripts (have others environment variables path contains python.exe location" not relevant here).

i can't change python location , contains spaces have introduce " " on path.

my issue following running little program, when console pop-up tried run %pythonpath% , obtained :

' "c:\program files\anaconda\lib\site-packages"' n'est pas reconnu en tant que co mmande interne ou externe, un programme exécutable ou un fichier de commandes.

i can't use inherited paths since environment called used other version of python , libs aren't located @ same places.

bool b = createprocessw( null, cmd2, null, null, false,     normal_priority_class| create_new_console, null, null, &startinf, &procinf ); 

i want add multiples values/paths contain spaces on paths.

does have clue on 1 ?

best regards,


Comments