Deshabilitar UAC del Windows

Deshabilitar UAC del Windows

Postby karinha » Tue Jun 10, 2014 3:16 pm

Buenos dias, como hago para Deshabilitar UAC del Windows? como en el ejemplo abajo:

Code: Select all  Expand view  RUN

#Include "FiveWin.ch"

STATIC oWnd

FUNCTION Main()

   LOCAL oBar

   DEFINE WINDOW oWnd TITLE "Deshabilitar UAC del Windows 7"

   DEFINE BUTTONBAR oBar _3D OF oWnd

   // EnableLUA
   // 0-Desativar - deshabilitar
   // 1-Ativar    - activar
   DEFINE BUTTON OF oBar ACTION UACV( 1 )

   SET MESSAGE OF oWnd TO "Deshabilitar UAC del Windows 7" NOINSET CLOCK DATE KEYBOARD

   ACTIVATE WINDOW oWnd

RETURN NIL

/ Para Windows Vista ou Seven a chave muda

FUNCTION UACV(nAtivar)
 *****************************************************
 * Grava o registro do aplicativo
 *****************************************************
 LOCAL cRunName, cRunKey, cRegKey

 // EnableLUA
 // 0-Desativar
 // 1-Ativar

 cRegValue:= nAtivar

 cRegKey := "SOFTWARE\Microsoft\Security Center"

 cRegRoot := HKEY_LOCAL_MACHINE

 SETREGVAR( cRegRoot, cRegKey, "UACDisableNotify", cRegValue )

RETURN 0

/*
// para Windows XP

FUNCTION UAC(nAtivar)

   *****************************************************
   * Grava o registro do aplicativo
   *****************************************************
   LOCAL cRunName, cRunKey, cRegKey
   // EnableLUA
   // 0-Desativar
   // 1-Ativar
   cRegValue:= nAtivar
   cRegKey := "Software\Microsoft\Windows\CurrentVersion\Policies\System"
   cRegRoot := HKEY_LOCAL_MACHINE
   SETREGVAR( cRegRoot, cRegKey, "EnableLUA", cRegValue )

 RETURN 0
*/


FUNCTION SETREGVAR(nKey, cRegKey, cSubKey, uValue)

   LOCAL oReg, cValue
   nKey := IF(nKey == NIL, HKEY_CURRENT_USER, nKey)
   uValue := IF(uValue == NIL, "", uValue)
   oReg := TReg32():Create(nKey, cRegKey)
   cValue := oReg:Set(cSubKey, uValue)
   oReg:Close()

RETURN cValue
 


Gracias, saludos
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Deshabilitar UAC del Windows

Postby Antonio Linares » Tue Jun 10, 2014 8:09 pm

João,

Tu función está correctamente creando ese valor y asignándole el valor 1.

No llega a desactivarte el UAC ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Deshabilitar UAC del Windows

Postby karinha » Tue Jun 10, 2014 8:20 pm

maestro, me genera este error:

Code: Select all  Expand view  RUN

Application
===========
   Path and name: C:\FWH1306\samples\uac.exe (32 bits)
   Size: 2,412,032 bytes
   Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20130422)
   FiveWin  Version: FWHX 13.05
   Windows version: 6.1, Build 7601 Service Pack 1

   Time from start: 0 hours 0 mins 10 secs
   Error occurred at: 06/10/14, 17:18:18
   Error description: Error BASE/1003  Variable does not exist: HKEY_LOCAL_MACHINE

Stack Calls
===========
   Called from: UAC.prg => UACV( 40 )
   Called from: UAC.prg => (b)MAIN( 16 )
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Deshabilitar UAC del Windows

Postby Antonio Linares » Wed Jun 11, 2014 7:51 am

Joao,

#define HKEY_LOCAL_MACHINE 2147483650
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Deshabilitar UAC del Windows

Postby karinha » Wed Jun 11, 2014 1:40 pm

Maestro, no esta haciendo ningun efecto en windows 7, que puede estar errado?

Code: Select all  Expand view  RUN

#Include "FiveWin.ch"

#define HKEY_LOCAL_MACHINE 2147483650

STATIC oWnd

FUNCTION Main()

   LOCAL oBar

   DEFINE WINDOW oWnd TITLE "Deshabilitar UAC del Windows 7"

   DEFINE BUTTONBAR oBar _3D OF oWnd

   // EnableLUA
   // 0-Desativar - deshabilitar
   // 1-Ativar    - activar
   DEFINE BUTTON OF oBar ACTION UACV( 0 )

   SET MESSAGE OF oWnd TO "Deshabilitar UAC del Windows 7" NOINSET CLOCK DATE KEYBOARD

   ACTIVATE WINDOW oWnd

RETURN NIL

// Para Windows Vista ou Seven a chave muda

FUNCTION UACV(nAtivar)

   *****************************************************
   * Grava o registro do aplicativo
   *****************************************************
   LOCAL cRunName, cRunKey, cRegKey

   // EnableLUA
   // 0-Desativar
   // 1-Ativar

   cRegValue:= nAtivar

   cRegKey := "SOFTWARE\Microsoft\Security Center"

   cRegRoot := HKEY_LOCAL_MACHINE

   SETREGVAR( cRegRoot, cRegKey, "UACDisableNotify", cRegValue )

RETURN 0

/*
// para Windows XP

FUNCTION UAC(nAtivar)

   *****************************************************
   * Grava o registro do aplicativo
   *****************************************************
   LOCAL cRunName, cRunKey, cRegKey

   // EnableLUA
   // 0-Desativar
   // 1-Ativar

   cRegValue:= nAtivar

   cRegKey := "Software\Microsoft\Windows\CurrentVersion\Policies\System"

   cRegRoot := HKEY_LOCAL_MACHINE

   SETREGVAR( cRegRoot, cRegKey, "EnableLUA", cRegValue )

RETURN 0
*/


FUNCTION SETREGVAR(nKey, cRegKey, cSubKey, uValue)

   LOCAL oReg, cValue

   nKey := IF(nKey == NIL, HKEY_CURRENT_USER, nKey)

   uValue := IF(uValue == NIL, "", uValue)

   oReg := TReg32():Create(nKey, cRegKey)

   cValue := oReg:Set(cSubKey, uValue)

   ? cValue, cRegKey

   oReg:Close()

RETURN cValue

/*
// Windows server

http://social.technet.microsoft.com/For ... ersecurity
*/

 


Regards, saludos

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Deshabilitar UAC del Windows

Postby Antonio Linares » Wed Jun 11, 2014 5:00 pm

Joao,

Aqui se comentá tu solución pero tambien dan otras indicaciones, igual puede servirte:

http://www.vistax64.com/vista-security/37180-user-account-control.html
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Deshabilitar UAC del Windows

Postby Kleyber » Wed Jun 11, 2014 5:02 pm

Kapi,

Estas executando o EXE em modo Administrador?
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Re: Deshabilitar UAC del Windows

Postby karinha » Wed Jun 11, 2014 5:14 pm

Kleyber wrote:Kapi,

Estas executando o EXE em modo Administrador?


Sim kleyber, não faz nenhum efeito. E a intenção é que não me peça administrador. pois quero executar um programa que pede administrador, entende?

obg. abs.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 105 guests

cron