Windows: mapped network drives are invisible to Qt classes when the application is run with admin privileges



  • As the title suggests, my problem is that QStorageInfo, QfileInfo etc. do not "see" the mapped network drives when the application is run as admin, but everything works when it's run normally. How so, what's going on? Can I make it work for admin applications as well? My application kinda needs to be run as admin to work properly.


  • Qt Champions 2017

    hi
    Well this is normal as admin is an other profile
    and the drives are not mapped there normally but only in the logged in profile.
    Sadly I have no good solution other than making it works as non admin.
    Maybe you could run normally but then do some operations as admin ?



  • That explains. So odd! Why are all the drives mounted for every user, but not network drives?..


  • Qt Champions 2017

    @Violet-Giraffe
    Well the drives like C are always there. And not pr profile.
    A mapped network drive is often mapped by some login script
    and belongs to the profile.
    Its also possible to map the same drives in admin profile
    but often it has not login script or a different one.

    You know what mapped drives will be there ?
    Or will app run on many setups and you have no idea what it will have?



  • @mrjj said:

    Or will app run on many setups and you have no idea what it will have?

    This ^^^


  • Qt Champions 2017

    @Violet-Giraffe
    Lets say for the argument that the drives was mapped under admin profile.
    In most company setup, local admin would have no read rights to the
    actual folders on the mapped drive. That is normally setup to normal domain user account.
    So not sure having the shares will make you happy.

    How do you run your app as admin ?
    And can I ask why it needs admin rights?



  • It's a file manager, it needs to be admin in order to copy/move/delete some files that the regular users can only read. I run it as admin either by right-clicking the shortcut -> Run as admin, or I can even set this flag permanently via Compatibility tab in the shortcut's properties.


  • Qt Champions 2017

    @Violet-Giraffe

    Ok. That way.

    So installer must set that up once you deploy to the other systems.

    What files would that be ?

    Also are you sure admin will be allowed to copy it to share?

    here at work the local admin has only right to local drives as he/it
    is not normal user so Server rejects him.
    Local admins are nothing to the domain controller.

    This might interest you
    http://www.winability.com/how-to-make-elevated-programs-recognize-network-drives/



  • That makes sense. I guess there's no point trying to circumvent this Windows policy. It won't make me happy, as you said :)
    And thanks for the link.


  • Qt Champions 2017

    @Violet-Giraffe

    Well it all depends on how the PC is setup but if on domain, the role of local admin is very different.
    Also, many place, its not possible to run apps as admin its disabled/controlled.

    But I still wonder what kind of files would be locked to normal user?
    You could look into
    Volume Shadow Copy
    http://www.howtogeek.com/howto/windows-vista/backupcopy-files-that-are-in-use-or-locked-in-windows/


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.