SshCommand opens a new shell for every command, so your commands are not in the same context.
In your case you can simply combine the commands by using "&&", "||" or ";".
http://www.livefirelabs.com/unix_tip_trick_shell_script/june_2003/06232003.htm
e.g. client.CreateCommand("cd /home/temp/ && ls -l")
In your case you can simply combine the commands by using "&&", "||" or ";".
http://www.livefirelabs.com/unix_tip_trick_shell_script/june_2003/06232003.htm
e.g. client.CreateCommand("cd /home/temp/ && ls -l")