I need to call ssh.exe from VS c++ codes to call a linux machine. I tried following from the Visual Studio 2013 c++ codes:
errno_t err = _set_errno(0); intptr_t t = _wspawnlp(_P_WAIT, sExeName.c_str(), sExeName.c_str(), sHost.c_str(), NULL);
ssh.exe is in my path: "C:\Program Files\OpenSSH-Win64" But I now get t = 255, without error, meaning that it already started call the ssh.exe, but didn't return 0. What does 255 means?
If I open the dos command prompt, and call the following line, it works fine:
"ssh [hostxxxx]@yyy . ~/.zzz.sh"
So what is wrong with my c++ codes?