Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to read registry key

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
555 Views, 8 Replies

How to read registry key

For a PowerMill macro, how does one go about reading a registry key string value?  I found REG EXPORT and REG QUERY commands but am not sure how to use them.  I tried them in a macro and they failed  (PowerMill 2021 Ultimate).

Labels (2)
8 REPLIES 8
Message 2 of 9
TK.421
in reply to: Anonymous

I dont see that in the Parameter Reference doc anywhere. where did you find those?

--------------------------------------
the numbers never lie
Message 3 of 9
Anonymous
in reply to: TK.421

I found REG EXPORT here: Link 

I found REG QUERY but now that I look at it again, I may have mistaken it for Powershell.  Either way, is it possible to query the registry?

Message 4 of 9
TK.421
in reply to: Anonymous

I'm not a super expert in this area. you could most likely do it from a batch file as was suggested in the original reply, or you could certainly do it via a plugin. What are you wanting to do?

--------------------------------------
the numbers never lie
Message 5 of 9
Anonymous
in reply to: Anonymous

I'm processing some SolidWorks part files and the output of that process is the input to PowerMill.  I have a set of 10 macros that run individually, and some macros use data that comes from SolidWorks.  I write data to various text files that the powermill macros read from but only if they know the location.  I need a static, readable location that the powermill macro can look at to find where those text files are located.  I was going to use the registry since that can be set with my program.

Message 6 of 9
kukelyk
in reply to: Anonymous

Hi, from a macro You can call a vbs to run

<macrocode>

OLE FILEACTION 'open' Your.vbs

</macrocode>

 

<vbscode>

'...

console_exe= CREATEOBJECT("Wscript.Shell").RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Delcam\Postprocessor\" & CurrentVersion & "\ExecutablePath")

</vbscode>

 

Message 7 of 9
TK.421
in reply to: kukelyk

Welcome back @kukelyk ! Are you going to be a regular on the forum again?

--------------------------------------
the numbers never lie
Message 8 of 9
Anonymous
in reply to: kukelyk

Thank you for your response.  How do I go about assigning the value of the registry key to a macro variable?  

Message 9 of 9
Anonymous
in reply to: kukelyk

Any update on the ability to read the registry?  Thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report