The problem with Q2 is that you're not starting your own program but you're starting CMD so you need to end CMD for the actual program to end, (which is what you do by typing exit.) You need to use the /c switch instead of the /k for CMD to terminate after executing the program. As for php ...
Actually, I believe paths are already saved relatively. I for instance use the same workspace at home and at work which is on a portable USB drive and the drive letters are not the same at home and at work.