WNetAddConnection2 will do the trick. Just use an empty string for the local device name, to avoid mapping a drive. You also want to make sure and close the connection when you're done. I wrap it into a NetworkConnection class that implements IDisposable.