Ted:
Were you able to read the Windows defender key? I thought it worked on my Win7 
box but it did not. It returned a 0 (meaning enabled) but that was the original 
default value.
The error code on the key open is a 2 in Win7 and Win8.1.
No issues on the registry. I've been around the block once or twice and made 
sure all was backed up before messing around.
I did change the permission to the key for the current user (owner) and it 
still did not work. It must be that this key is system locked. But I could read 
the key for Microsoft Security Essentials,  Go figure...
Other keys using the registry class opened and read fine (from what I tested) 
in bout 7 and 8.1.
Is there a registry entry that lists the current anti-virus software?
Thanks for your help.
Best regards
Jack


________________________________________
From: ProfoxTech [profoxtech-boun...@leafe.com] on behalf of Ted Roche 
[tedro...@gmail.com]
Sent: Wednesday, January 14, 2015 1:56 PM
To: profoxt...@leafe.com
Subject: Re: VFP6: Windows 8.1 Read A Registry Key

Hi, Jack:

I suspect this error is the same reason your original code didn't work. As
I said, I ran the code on my sole Win 8.1 box here, and it ran fine.

If you open the registry in RegEdit (the usual disclaimers apply: make
backups, don't change anything; if apocalypse occurs, it's not my fault)
and see if you can navigate to HKLM/Software/Microsoft... etcetera. Perhaps
the problem is that the key isn't yet there, in which case you should
likely test for the existence of elements in the branch: Windows Defender,
and on down.




On Wed, Jan 14, 2015 at 1:01 PM, Jack Skelley <jskel...@newjerseydevils.com>
wrote:

> Good Afternoon Ted:
> In regopenkey in registry.prg returns an error of 2.
> I think error 2 means the key can't be opened.
> Using the registry class in Windows 7 works fine.
> Thanks for the help.
> Jack
>
> ________________________________________
> From: ProfoxTech [profoxtech-boun...@leafe.com] on behalf of Ted Roche [
> tedro...@gmail.com]
> Sent: Tuesday, January 13, 2015 7:56 PM
> To: profoxt...@leafe.com
> Subject: Re: VFP6: Windows 8.1 Read A Registry Key
>
> I've never tried to use WScript to do this. VFox ships with several
> different samples that read the Registry. This works on my Win 8.1 machine:
>
> #DEFINE HKEY_LOCAL_MACHINE          -2147483646  && BITSET(0,31)+2
>
> LOCAL regfile, oReg, lnValue, llRetVal
>
> regfile = HOME(2)+"classes\registry.prg"
>
> SET PROCEDURE TO (m.regfile) ADDITIVE
>
> oReg = CreateObject("registry")
>
> lnValue = 0
>
> llRetVal = oReg.GetRegKey("DisableAntiSpyware",@lnValue,;
>   "Software\Microsoft\Windows Defender",;
>   HKEY_LOCAL_MACHINE)
>
>  WAIT WINDOW "The value is " + STR(lnValue)
>
> On Tue, Jan 13, 2015 at 6:37 PM, Jack Skelley <
> jskel...@newjerseydevils.com>
> wrote:
>
> > Good Evening All:
> > I would like to be able to read a registry key in Windows 8.1 to see if
> > the Windows Defender is active. So:
> > gbError = .f.  &&on error handles a key not found
> > goWSHShell = CreateObject("WScript.Shell")
> > lcKey = "HKLM\SOFTWARE\Microsoft\Windows Defender\DisableAntiSpyware"
> > lnReturn = goWSHShell.RegRead(lcKey)
> > do case
> >   case gbError
> >       gcDefender  = "Microsoft Windows Defender Key Not Found..."
> >   case lnReturn = 1
> >      gcDefender  = "Microsoft Windows Defender Found And Enabled..."
> >   case lnReturn = 0
> >     gcDefender  = "Microsoft Windows Defender Present But Not Enabled..."
> > endcase
> > wait window gcDefender timeout 1
> > I have zero issues reading a registry key in Windows 7 but in 8.1 I get
> an
> > error 'invalid root key'
> > I am sure it has something to do with the permissions of the key. I
> > checked the permissions this and it gives 'read' rights to all users.
> > But I still can't access the key.
> > So how do you accesses the key? Thanks for any help.
> > Best regards
> > Jack
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/7d9e7f72b813014c8fd022cf04f820ed0170813...@ex08.drdad.thenewarkarena.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to