in reply to Command line works

Use system("cd ../../; . setup-env")

But remember that this cd won't affect other processes.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.