There's probably a fancier answer to that, but you can just shell out to 
it: readall(`powershell -Command "Get-ChildItem -Path hkcu:"`)

This may end up being just a slower, different, equally hard-to-parse way 
of accomplishing what you were already doing via reg query, but powershell 
has a lot of scripting functionality that's orders of magnitude nicer than 
cmd. Unlike bash it's an object-oriented shell which is occasionally useful.


On Wednesday, May 13, 2015 at 1:33:15 AM UTC-7, Simon Byrne wrote:
>
> I admit to having never used powershell: is there an easy way to call it 
> from Julia?
>
> -s
>
> On Wednesday, 13 May 2015 00:38:50 UTC+1, Tony Kelman wrote:
>>
>> It's likely to be quite a bit less efficient than going through the Win32 
>> C API, but you can also do much of this through powershell which should be 
>> quicker to write: 
>> https://technet.microsoft.com/en-us/library/dd315270.aspx
>>
>>
>>
>> On Tuesday, May 12, 2015 at 9:22:10 AM UTC-7, David Anthoff wrote:
>>>
>>> I think there should be a WindowsAPI.jl package where people can put all 
>>> wrappers for the low level C interfaces that the Windows API defines. It 
>>> could (over time) hold all the data structure definitions, and wrappers for 
>>> the various Win32 function calls.
>>>
>>>  
>>>
>>> Maybe a higher level registry package could then depend on that 
>>> WindowsAPI.jl package?
>>>
>>>  
>>>
>>> *From:* julia...@googlegroups.com [mailto:julia...@googlegroups.com] *On 
>>> Behalf Of *Simon Byrne
>>> *Sent:* Tuesday, May 12, 2015 3:55 AM
>>> *To:* julia...@googlegroups.com
>>> *Subject:* [julia-users] Access Windows registry from Julia?
>>>
>>>  
>>>
>>> The Windows registry useful to determine installation paths of other 
>>> software and whatnot. I've hacked together some code using the REG QUERY 
>>> command:
>>>
>>>
>>> https://github.com/JuliaStats/RCall.jl/blob/e4ba35cf45ca2eb041f660642449b8259c2f30e3/deps/build.jl#L13
>>>
>>> but it is somewhat complicated (and potentially unreliable) to parse.
>>>
>>>  
>>>
>>> Has anyone had any luck using the C interface? It looks a little 
>>> complicated, so if anyone has any examples, I would be grateful. I guess 
>>> ideally we would want to wrap the C interface into package, similar to 
>>> _winreg in Python:
>>>
>>> https://docs.python.org/2/library/_winreg.html
>>>
>>>  
>>>
>>> Perhaps we need an "up for grabs packages" list?
>>>
>>>  
>>>
>>> s
>>>
>>>  
>>>
>>> P.S. On that note, perhaps we should put the Julia installation path in 
>>> the registry, for other software that might need to find it: both R and 
>>> Python do it.
>>>
>>

Reply via email to