Finally found a solution myself.
If you already have a connection to the remote machine with a particular user name and password, then the pipe will try to use the same user name and password. This can be achieved with 'net use':
The programmatic way to do this is using the WNetAddConnection2() function. So the full solution is to call WNetAddConnection2() with the required user name and password, then open the pipe in the normal way.Code:>net use \\server\IPC$ /user:username password




Reply With Quote