brian873 Posted April 28, 2005 Share Posted April 28, 2005 If I were to write vales to the registry to let me know what applications a users had how could I read the values back via a batch script ?This is really bugging me…Thanks any help Link to comment Share on other sites More sharing options...
Martin Zugec Posted April 28, 2005 Share Posted April 28, 2005 Sorry, I think I didnt understand question... You want to know what apps have user installed? Link to comment Share on other sites More sharing options...
brian873 Posted April 28, 2005 Author Share Posted April 28, 2005 Sorry I really need to check my typingWhen an application is installed silently, I would like to write a registry value to say it was installed. Then at a later date I would like to have the ability to scan a registry for all of the values that I flag as installed. So I could get an output likeWinzip = 1 installedOfficeXP = 0 not installedAVG = 1 installedHope this explains better Link to comment Share on other sites More sharing options...
Martin Zugec Posted April 28, 2005 Share Posted April 28, 2005 Ah, I see...Well, it is simple, I am using something GUID for applications.You must just use REG QUERY and REG ADD commands - they returns errorlevels. If you want help, just let me know Link to comment Share on other sites More sharing options...
brian873 Posted April 28, 2005 Author Share Posted April 28, 2005 Thanks Soulin I will try it myself and post the results, one thing you could help me with is the best place to write me own values or does it matter ? I was thinking of usingHKEY_LOCAL_MACHINE / SOFTWARE / _MY SOFTWARE / {string values}winzipofficeAVGWhat do you think ??? Link to comment Share on other sites More sharing options...
ravashaak Posted April 28, 2005 Share Posted April 28, 2005 Soulin is correct. You can use REG ADD and REG QUERY to write and read data from the registry. Errorlevels are returned for the presence or absence of the value for which you query.Also of note: In many instances, programs will write registry keys and values when they are installed (silently or otherwise). You can often determine these on your own and query for them without needing to add a custom entry yourself. *Most* applications write a subkey to HKLM\SOFTWARE\. That's usually the first place to check for registry entries. They will most often appear under either the application name, or the company name. Many developers (but not all, unfortunately) even include values reflecting program versions. This can be handy in certain circumstances. - Ravashaak Link to comment Share on other sites More sharing options...
ravashaak Posted April 28, 2005 Share Posted April 28, 2005 HKEY_LOCAL_MACHINE / SOFTWARE / _MY SOFTWARE /{string values}winzipofficeAVGWhat do you think ???I see no problem with your structure. However, you might want to write a subkey for each application instead of just values all lumped into one key. It really depends upon your needs. However, if you created subkeys for each application, you could create a value for the application version within each subkey (just in case you later needed an easy way to programatically determine the installed version of an application). - Ravashaak Link to comment Share on other sites More sharing options...
Martin Zugec Posted April 28, 2005 Share Posted April 28, 2005 2brian: It depends For example I am creating GUID values... If you want to use per user installations, you must make it to HKCU, if per-computer, you must make it in HKLM... 2ravashaak: For example I am using this method when I want to make per-computer settings, that will occur only once (yesterday I deployed collector from Application Compatibility Toolkit using this method) Link to comment Share on other sites More sharing options...
MHz Posted April 28, 2005 Share Posted April 28, 2005 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\UninstallI would monitor them here. The uninstall keys are here when installed, and removed upon uninstall. Seems the most suitable to myself, to choose. Link to comment Share on other sites More sharing options...
Martin Zugec Posted April 28, 2005 Share Posted April 28, 2005 If it is MSI based, I like to use WMI Class Win32_Product... Otherwise method MHz mentioned... Link to comment Share on other sites More sharing options...
brian873 Posted April 28, 2005 Author Share Posted April 28, 2005 Thanks guys.... got it working withCommandREG QUERY HKLM\Software\_MYSOft /sOutput! REG.EXE VERSION 3.0HKEY_LOCAL_MACHINE\Software\_MYSOftHKEY_LOCAL_MACHINE\Software\_MYSOft\AVG <NO NAME> REG_SZ Installed REG_SZ 0HKEY_LOCAL_MACHINE\Software\_MYSOft\Office <NO NAME> REG_SZ installed REG_SZ 1HKEY_LOCAL_MACHINE\Software\_MYSOft\Wizip <NO NAME> REG_SZInstalled REG_SZ 0Soulin, excuse my ignorance but where do you write GUID values and what are the benefits of doing it this way ?thanks Link to comment Share on other sites More sharing options...
Martin Zugec Posted April 28, 2005 Share Posted April 28, 2005 It is little bit complicated - I am storing it to HKLM\Software\ExecutionCheck - in every GUID I am also including date+time of creation, so sometime (when I need) I can make time based rules, e.g. run every 3 hours or once per day etc... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now