Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Windows: mapped network drives are invisible to Qt classes when the application is run with admin privileges
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 2.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Violet Giraffe
    wrote on 3 Nov 2015, 07:52 last edited by Violet Giraffe 11 Mar 2015, 07:52
    #1

    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.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 3 Nov 2015, 09:37 last edited by mrjj 11 Mar 2015, 09:38
      #2

      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 ?

      1 Reply Last reply
      1
      • V Offline
        V Offline
        Violet Giraffe
        wrote on 3 Nov 2015, 09:59 last edited by
        #3

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

        M 1 Reply Last reply 3 Nov 2015, 10:03
        0
        • V Violet Giraffe
          3 Nov 2015, 09:59

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

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 3 Nov 2015, 10:03 last edited by
          #4

          @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?

          V 1 Reply Last reply 3 Nov 2015, 10:06
          0
          • M mrjj
            3 Nov 2015, 10:03

            @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?

            V Offline
            V Offline
            Violet Giraffe
            wrote on 3 Nov 2015, 10:06 last edited by
            #5

            @mrjj said:

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

            This ^^^

            M 1 Reply Last reply 3 Nov 2015, 10:11
            0
            • V Violet Giraffe
              3 Nov 2015, 10:06

              @mrjj said:

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

              This ^^^

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 3 Nov 2015, 10:11 last edited by mrjj 11 Mar 2015, 10:11
              #6

              @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?

              1 Reply Last reply
              0
              • V Offline
                V Offline
                Violet Giraffe
                wrote on 3 Nov 2015, 10:19 last edited by
                #7

                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.

                M 1 Reply Last reply 3 Nov 2015, 10:26
                0
                • V Violet Giraffe
                  3 Nov 2015, 10:19

                  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.

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 3 Nov 2015, 10:26 last edited by
                  #8

                  @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/

                  1 Reply Last reply
                  1
                  • V Offline
                    V Offline
                    Violet Giraffe
                    wrote on 3 Nov 2015, 10:27 last edited by Violet Giraffe 11 Mar 2015, 10:28
                    #9

                    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.

                    M 1 Reply Last reply 3 Nov 2015, 10:34
                    0
                    • V Violet Giraffe
                      3 Nov 2015, 10:27

                      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.

                      M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 3 Nov 2015, 10:34 last edited by
                      #10

                      @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/

                      1 Reply Last reply
                      0

                      8/10

                      3 Nov 2015, 10:26

                      • Login

                      • Login or register to search.
                      8 out of 10
                      • First post
                        8/10
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved