Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

(OT) Windows Vista UAC

by jschollen (Beadle)
on Jan 25, 2007 at 15:53 UTC ( [id://596523]=perlquestion: print w/replies, xml ) Need Help??

jschollen has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

Got a question about Windows Vista...
I've written a device detection on Windows XP (using devcon.exe), where it works fine.
When I try to port it to Windows Vista, the UAC comes popping up all the time (since I call devcon.exe several times in order to detect the device needed).
(Due to the working principles of devcon.exe, I have to call it several times)

Is it possible to (programmatorically) disable UAC?
Or, to elevate the user rights in such a way that UAC only asks once for authentication?

Thanks in advance.

I did notice that WMI can be ran on Windows Vista with lowest user right, whithout UAC complaining. Unfortunately, I have to rewrite everything if I want to use WMI in stead of devcon.exe. That's why I'm trying to get devcon.exe up and running in this way.

Replies are listed 'Best First'.
Re: (OT) Windows Vista UAC
by marto (Cardinal) on Jan 25, 2007 at 16:41 UTC
    jschollen,

    "Is it possible to (programmatorically) disable UAC?"

    This may not be any use to you, however if you can access the registry (depending on your account privileges) you could check the registry key (using Win32::TieRegistry):
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\ CurrentVersion\Policies\System\EnableUAC
    If it is set to 0 then it is disabled, else set it to 0 (its default is 1). A reboot is required before the change will take effect. I guess you could fall back on using WMI if you can not do this.

    Hope this helps

    Martin
      Thx Martin.
      I will use it as a last resort.
      I was hoping to find another solution.

      I did find out that UAC is a system service, but unfortunately I'm not able to shut it down :-(
      I also tried to run devcon.exe multiple times into a single process, but this effort did also not work :-(
      (Since Microsoft claims that UAC only complains one on a single process, it would have been a nice solution. But apperantly devcon.exe is not ment to work in such a way)
        Well I have not used Vista yet (<rant>I mean 15GB disk space minimum required? Come on...</rant>), however I have read about the "enhanced security" and so on. If you do not have sufficient account privileges to disable UAC then (from what I have read) you may have to use WMI. Who knows, I have not seen your code, but it may be quicker to do a rewrite using WMI that it would be to try and figure out a way around this new "uber secure" version windows. Have you seen the DBD::WMI module?

        I am not fully aware of the user account privileges setup for Vista. Perhaps there is some sort of exclusion (or trusted apps) list that your system administrators could include your application in.

        Good luck,

        Martin

        The process that triggers UAC is the one running devcon, not the one calling devcon. You launch devcon multiple times, creating multiple processes. Each one of those triggers UAC no more than once.

Re: (OT) Windows Vista UAC
by dragonchild (Archbishop) on Jan 25, 2007 at 18:19 UTC
    If it was possible to programmatically disable UAC, then UAC wouldn't be worth very much, would it?

    The correct solution is to do whatever it is that installers (such as for games) do when doing device detection (for things like "What is the video card?", etc). It may not be devcon, but that may be the price of supporting a b0rked OS like Vista.


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re: (OT) Windows Vista UAC
by ikegami (Patriarch) on Jan 25, 2007 at 17:42 UTC

    Is it possible to (programmatorically) disable UAC?

    You tell us! If you need help implementing it in Perl, we can help you. Until then, I don't see how this is a Perl question.

    If you were open to alternatives to devcon, then I could see this being a Perl question. However, you stated you wish to avoid this.

      A good alternative to devcon is always welcome.
      That's why I was experimenting with WMI.
      I can achieve the same thing with WMI, but it requires a lot of change into the current system I'm working in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://596523]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2024-04-23 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found