Your code has several problems:
1. If you modify the path in this way, you need to start a new instance of the console.
2. WIth Openconsole you can not rely excute something.
Here is an other way:
Code: Select all
Prog = RunProgram("cmd", "", "", #PB_Program_Open | #PB_Program_Read | #PB_Program_Write | #PB_Program_Error)
*Buffer = AllocateMemory(1024)
WriteProgramStringN(Prog, "@set PATH=%PATH%;C:\your\path\here\")
WriteProgramStringN(Prog, "@echo %PATH%")
Delay(1000)
While AvailableProgramOutput(Prog)
Length = ReadProgramData(Prog, *Buffer, AvailableProgramOutput(Prog))
If Length
Debug PeekS(*Buffer, Length, #PB_UTF8|#PB_ByteLength)
EndIf
Wend
Delay(2000)
If you check the debug output, you will see the added path entry at the end.