[ESS] Windows suggestion: ask registry for location of Rterm.exe

Rodney Sparapani rsparapa at mcw.edu
Fri Jun 15 20:53:06 CEST 2012


On 06/15/2012 12:06 PM, Rodney Sparapani wrote:
> Hi Paul:
>
> Very nice thoughts. I'm just going to react to this part which seems
> to be the most straightforward. I think you can call this from elisp.
> But, the problem with this code is that it doesn't work, does it? Here's
> what I get on Windows XP:
>
> H:\>reg query hklm\software\R-core\R /v InstallPath
>
> Error: The system was unable to find the specified registry key or value
>
> H:\>reg query hklm\software\wow6432Node\r-core\r /v InstallPath
>
> Error: The system was unable to find the specified registry key or value
>
> What do you see?
>
> Rodney
>

Oh, hang on.  For me, I need

H:\>reg query hkcu\software\R-core\R /v InstallPath
! REG.EXE VERSION 3.0

HKEY_CURRENT_USER\software\R-core\R
     InstallPath REG_SZ C:\Documents and Settings\rsparapa.MCWCORP\My 
Documents\R\R-2.14.2

Ok, I think I see what is going on.  You need to check each ROOTKEY
[ HKLM | HKCU | HKCR | HKU | HKCC ]

REG QUERY KeyName [/v ValueName | /ve] [/s]

   KeyName    [\Machine\]FullKey
     Machine - Name of remote machine,  omitting defaults to the current 
machine
          Only HKLM and HKU are available on remote machines
     FullKey  - in the form of ROOTKEY\SubKey name
          ROOTKEY  [ HKLM | HKCU | HKCR | HKU | HKCC ]
          SubKey  - The full name of a registry key under the selected 
ROOTKEY
   /v  query for a specific registry key
          ValueName  - The name, under the selected Key, to query
          if omitted, all values under the Key are queried
   /ve query for the default value or empty value name <no name>
   /s  queries all subkeys and values

So, that code is incomplete.  But, it could easily be adapted.

Rodney



More information about the ESS-help mailing list