Click here to Skip to main content
15,886,868 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am trying to write a batch file that checks if .NET 3.5 is installed. I know that running the following command produces the result:

reg query "HKEY_Local_Machine\Software\Microsoft\NET Framework Setup\NDP\v3.5" /v Install


But how can I get hold of the value (0 or 1) and make use of it in an if statement, so that I know whether to install .NET or not?

Many thanks in advance.
Kind regards,
Posted

1 solution

Hi Programm3r,

I'm answering using Ubuntu right now so I couldn't test it right now but what you're looking for is something like:

For /F %%A In ('reg query "HKEY_Local_Machine\Software\Microsoft\NET Framework Setup\NDP\v3.5" /v Install') do goto skip

Echo reg value not found 

goto done

:skip

Echo reg value found 

:done



Good luck!
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900