Announcement

Collapse
No announcement yet.

Enable or Disable UAC

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Enable or Disable UAC

    Hi Forum, I need a little help with the code.
    My application includes a lot of third party executables, they are simple application for my pupils.
    Often I have some problem with UAC, Administrator Rights and similar.
    I tried "Require Administrator" and other option in my application but no changes.

    So I created a button with this code
    Code:
    result = Shell.Execute("UserAccountControlSettings.exe", "open", "", "", SW_SHOWNORMAL, false);
    It simply shows the UAC panel.

    Now I would avoid this option and insert to buttons that directly Enable or Disable the User Account Control.
    I found a way using bath files. By using Shell.Execute, I launch the BAT file, reboot Windows and it works perfectly. But I d0n't like this kind of solution and I would to launch the BAT code directly from a button.

    I found two codes to change UAC status:

    Enable UAC
    %SYSTEMDRIVE%\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Pol icies\System /v EnableLUA /t REG_DWORD /d 1 /f

    Disable UAC
    %SYSTEMDRIVE%\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Pol icies\System /v EnableLUA /t REG_DWORD /d 0 /f


    Well I tried for five days to execute them with Shell.Execute and File.Run without success. I'm in trouble wit executables, arguments and more.

    Please Forum, suggest me the right way to launch this code, possibly with Shell.Execute.
    As usual, THANKS.

  • #2
    Moreover I tried te code below to enable UAC but no effects
    Code:
    Registry.SetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System", "EnableLUA", "1", REG_DWORD);
    Could anyone confirm this?
    Thanks

    Comment


    • #3
      Possible more than 50 visits without a solution or confirmation?
      Could some Master User helps me?
      On this Forum I asked for other doubt, suggestion etc.
      Most people here know that I have not bad intentions, I create little and basic GUI for the school, all for free and using free software like AMSPE.

      Now UAC is a problem for pupil's parents, please suggest me something, I don't create malicious software or dirty application like that.

      I hope in your reply but if you think that this cod could be used in a wrong way from a stupid user, tell me it with a PM.

      Thanks in advance.

      Comment


      • #4
        You shouldn't disable the UAC. There is really no valid excuse. If the program only works with admin privileges, then fix the program, don't modify the computer just to make a badly written program work.

        Ulrich

        Comment


        • #5
          No Ulrich, the problem is not my program, basically a simple gui with some info about pupil, classroom etc.
          The real problem are the included applications, written very bad from some "professional programmer".
          It's impossible use them with UAC enabled, then everyone needs to be launched as administrator by right click and so on.
          Try to do this for more than 15 applications, it's very annoying.
          Parents continuously ask me for a solution, I solved it launching the previous batch file before reboot windows.
          Obviously I included a complete information panel about the UAC and it's effects.
          Believe in me, I's all I can do, I tried everything without positive results.
          I asked here only for a more clean solution because I don't like launch those files.
          Also I know that my method is already not clean, but the only way should be rewrite every single application and it's is impossible.
          I hope you understand my needs, again believe in me and my intention, I hate virus, forcing the system, *****ed program and more. Legality is at first place in my life.
          Thanks for your time.

          Comment


          • #6
            UAC is triggered by the manifest so edit the manifest of all the bundled applications so that UAC/Admin is not needed in the first place, if the bundled applications really are just simple educational things then they wont need full system control anyway.

            Comment


            • #7
              You are right, but as I said before, the bundled application are not mine
              and no one want change them.
              I repeat, I solved the problem launch batch files, I only would to use a more clean solution.
              I ask you only a thing, try to understand my limits and more I'm surrounded by
              people ("professional programmer") without competence.
              Finally I'm not a genius, but I don't say to be a Professional Programmer.

              If anyone could help me ...

              Comment


              • #8
                They do not need to be yours to edit the manifest as the manifest is simply a plain text .xml file wrapped in the .exe that is editable from any .exe editor.

                Comment


                • #9
                  Originally posted by Drag View Post
                  The real problem are the included applications, written very bad from some "professional programmer".
                  It's impossible use them with UAC enabled, then everyone needs to be launched as administrator by right click and so on.
                  Try to do this for more than 15 applications, it's very annoying.
                  Can you share one or two of these applications, so we can determine why they need to be run "as administrator" via right click?

                  If these executables were coded by a contractor and paid for, somebody could perhaps ask him that they get updated to conform to what was once called Vista-compliance.

                  Ulrich

                  Comment


                  • #10
                    Edit the exe files with ResHack or similar? Good but lightly illegal.
                    Share the applications? Oh no, it's a shame and them are too big. For example the lightest application is a custom and authorized LibreOffice package full of images for educational and tons of useful/unuseful models. Why don't delete models and images so I can send you the package? Because all productions are virtualized using a single executabe.
                    The reason because UAC ask for permission? Dear Ulrich, as you have explained in your article, a programmer need to know how to deploy a software. If that software stores settings and data pratically everywhere, UAC window is absolutely normal, but I can't do anything.
                    Anyway I understand your point of view and your worries.
                    So, I finally found a solution by adding another key with another value to stop/start UAC.
                    Now I respect your right ideas and I will not share this code so, some stupid user who want to cause problems on people's PC is cut out.
                    Thank you anyway, Drag.

                    Comment


                    • #11
                      It is not 'illegal' to change an exe file to run as a standard user. UAC is not normal at all and most things once installed work without the need for Admin rights. Dont think you are going to get any further with this untill you give example softwares.

                      Comment


                      • #12
                        No Shreck, you are wrong, if the exe file isn't your, you can't edit it, It's out of the term of freeware license.
                        I only create the GUI, a panel to launch application that includes informations about any pupil or teacher. All the real programs are not mine so I can't touch them.
                        Obviously they are very low quality productions create but ultra low quality "professional programmer"
                        Anyway, as said before, I solved the problem adding another key to change to the first previous posted.

                        Comment


                        • #13
                          You can disable UAC by toggling this setting:

                          [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Policies\System]
                          "EnableLUA"=dword:00000000
                          0 = Disabled
                          1 = Enabled

                          It will not take effect until you restart the system and there's not getting around this.

                          Comment


                          • #14
                            But as was said, this is not a good idea, changing global security settings without letting the user know.

                            Comment


                            • #15
                              And you can change it with Registry.SetValue.

                              PS: you might want to enable the forum edit function.

                              Comment

                              Working...
                              X