jeremy, your modification to cli_nt_session_open() was to hide the fnum in the struct cli_state (which i'm not keen on). however, you then do cli_close(&cli, cli.nt_pipe_fnum) which is inconsistent with the hiding in cli_nt_session_open(). this is more of a crime :-) can you put it one way or the other! lukes