I need to programmatically connect to a network server/share, but, due to policy, can’t establish a mapping, even temporarily. I know I can use an API call like “WNetAddConnection2” to locate a server and map a logical drive to it, but this violates the “no mapping” rule. The goal is to be able to read files on the remote server, then break the connection. The user should be unaware of the remote connection, and unable to see this connection in Windows (e.g. Explorer, Connections, etc.).
Does anyone know of an API like WNetAddConnection2 that will allow me to connect to a remote server, ideally with a UNC path, without having to map a drive?