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