in reply to Command line works
Use system("cd ../../; . setup-env")
But remember that this cd won't affect other processes.