Results 1 to 17 of 17

Thread: how to disable vista UAC

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    15

    how to disable vista UAC

    Hi !

    It's possible to disable the Vista UAC programatly?

    I have to port my application to Vista, and I need to disable the UAC, also temporarily..

    Have you Any Advice?


    Thanks

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: how to disable vista UAC

    If you need to turn off UAC your application is not ported for Vista
    You can not turn off UAC without a restart of the computer, you need to change or create a DWORD in the registry and name it EnableLUA at this point:
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
    and set it to 0. Change it to 1 to turn UAC back on.

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    15

    Re: how to disable vista UAC

    You are right !

    But I have to change network card setup (IP and Subnetmask) and share some folder, and in my application I used the WMI, and with WMI if you don't turn off UAC you can't do anythinks (I think ).

    Also change register value if I have UAC ON it's impossible !

    Have you some advice ?

    Thanks

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: how to disable vista UAC

    You can change the registry entries and I also think you can run WMI, however the application need Administrator privileges. Instead of turning UAC off you should change the manifest and require the elevated privileges.

  5. #5

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    15

    Re: how to disable vista UAC

    I tried to change the privilege with the this manifest file:

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" 
    xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <assemblyIdentity version="0.9.0.0" name="DSSNetworkConfigurator"/>
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
          <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
            <!-- UAC Manifest Options
                If you want to change the Windows User Account Control level replace the 
                requestedExecutionLevel node with one of the following.
    
            <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
            <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
            <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />
    
                If you want to utilize File and Registry Virtualization for backward 
                compatibility then delete the requestedExecutionLevel node.
            -->
            <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
          </requestedPrivileges>
        </security>
      </trustInfo>
    </asmv1:assembly>

    But it doesn't work. Perhaps I make a mistake somewhere.

    My manifest file is called app.manifest and I copied it in to the exe directory.

    Where I 'm wrong ?


    Thanks

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: how to disable vista UAC

    Did you copy it manually or do you let Visual Studio do it for you? If you let VS do it it should be renamed from app.manifest to <YourAppName>.exe.manifest, so make sure that is actually the name of the manifest file.

  7. #7

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    15

    Re: how to disable vista UAC

    I copied the manifest file manually.

    It's possible to set VS 2005 to make it automactly?

    I searched on the app properties but i didn't find anythink !


    Thanks for all your reply you give me a strong help in my job !

  8. #8
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: how to disable vista UAC

    I don't remember with VS 2005. Does it work now after you renamed the manifest?

  9. #9
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: how to disable vista UAC

    Is this disabling a temporary measure for yourself to get your app working on Vista, or is this something you plan to do on your customers computers?

    I would highly advise against turning off UAC at all on a customers computer. If that were to happen to me, I would consider the app a virus, regardless of how legit it may be.

    If this is internal, like for a company you work for, then its a different story and it shouldnt be a big deal so long as your company allows it.

    However if this is just for you on your own computer, why don't you just log into Vista as "administrator". When you do this, Vista UAC doesn't get in the way, and the administrator account on Vista runs just like anyone in the administrators group would run on XP.

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: how to disable vista UAC

    Are you talking about the real Administrator account Matt? It should still prompt you but not require login credientials.

    If your computer is running an antivisue, attempting to turn off the UAC may raise a flag for the AV software. The best solution is to code it properly instead of trying to bypass security.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: how to disable vista UAC

    yes, the "real" administrator account. You should not get ANY UAC prompts in Vista when logged in as that account. I don't on my Vista boxes.

    Even if you go to the Run command in the start menu (if you enabled it) it will have a special note when you are running under the administrator account saying "this process will be run with administrative rights" or something of that nature.

    Are you saying you DO see UAC prompts in Vista when logged in as administrator?

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: how to disable vista UAC

    Hmm, well if you just tried then I will go with that as its been a while since i logged in as the actual administrator and of course Im at work now where we are still on that sad OS called XP lol.

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  13. #13
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: how to disable vista UAC

    I didn't just try (@ work on XP too ), so there is a chance I am totally crazy and wrong, but I have used Vista a good amount on my laptop (but ive been on Win7 beta for 2 months now) and I am pretty sure I am correct.

  14. #14
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: how to disable vista UAC

    And Ive just got to work and am on my first cup of coffee but I have used vista for 2.5 years now.

    Is this elevation necessary for hte entire application? Its best design to write a separate component that does the task and raise just that process instead of the entire application.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  15. #15

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    15

    Re: how to disable vista UAC

    Thanks to ALL !

    I have resolved my problem with the inclusion of manifest file.

    But another problem raise up...

    How I can check ,and eventually turn of the request of username and password to access to shared folder ?


    thanks

  16. #16
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: how to disable vista UAC

    The shared folder has permissions set?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  17. #17

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    15

    Re: how to disable vista UAC

    Yes the folder are shared, and EVERYONE can access in, but only if they insert username and password.

    In the Vista control panel there is an option that if disable permits to access to shared folder WITHOUT insert username and password.

    How I can check , and eventualy change, the status of this flag ?


    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width