Windows.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:lib9 作者: Jumpscale 项目源码 文件源码
def isVistaUACEnabled(self):
        """
        Return boolean indicating whether this is a Windows Vista system with
        User Account Control enabled.

        Warning: If modifies the UAC setting but has not yet rebooted,
        this method will return the wrong result.
        """

        if self._isVistaUACEnabled is not None:
            return self._isVistaUACEnabled

        if self.getWindowsVersion() != self.VERSION_VISTA:
            return False
        hkey = reg.HKEY_LOCAL_MACHINE
        key = 'Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System'
        value = 'EnableLUA'
        if not self.registryHasValue(hkey, key, value):
            self._isVistaUACEnabled = False
        elif self.getValueFromRegKey(hkey, key, value) == 0:
            self._isVistaUACEnabled = False
        else:
            self._isVistaUACEnabled = True
        return self._isVistaUACEnabled
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号