Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to force a Windows mapped drive to refresh



  • I'm looking for a programmatic way to force a Windows mapped drive to refresh. It is configured to reconnect at log-on, but if the drive is not available, it won't be connected. If it becomes available at a later time, the user can open the drive from Windows Explorer and it'll repair the connection. Is there a way to do this programmatically? It doesn't have to be cross platform per se, but a Qt way if one exists would be handy.

    I found WNetRestoreConnection, but it is removed from Windows Vista and above, and I'm writing on Windows 7 right now.

    Thanks in advance.
    Andrew



  • "QProcess":http://doc.qt.nokia.com/4.7/qprocess.html , net.exe and the appropriate "commands":http://www.computerhope.com/nethlp.htm


Log in to reply